From 62e3593944846c0e7395586183986e0f11ad9544 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 15 Mar 2021 01:59:52 +0100 Subject: Tweak duration_to_string formatting --- src/util/string.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/util/string.h b/src/util/string.h index d4afcaec8..21f1d6877 100644 --- a/src/util/string.h +++ b/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(); -- cgit v1.2.3