Skip to content
Permalink
Browse files

Tweak duration_to_string formatting

  • Loading branch information
Wuzzy2 authored and sfan5 committed Mar 16, 2021
1 parent 9113538 commit 62e3593944846c0e7395586183986e0f11ad9544
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/util/string.h
@@ -670,15 +670,19 @@ inline const std::string duration_to_string(int sec)

std::stringstream ss;
if (hour > 0) {
ss << hour << "h ";
ss << hour << "h";
if (min > 0 || sec > 0)
ss << " ";
}

if (min > 0) {
ss << min << "m ";
ss << min << "min";
if (sec > 0)
ss << " ";
}

if (sec > 0) {
ss << sec << "s ";
ss << sec << "s";
}

return ss.str();

0 comments on commit 62e3593

Please sign in to comment.