aboutsummaryrefslogtreecommitdiff
path: root/src/util/string.h
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2021-03-26 14:00:57 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2021-03-26 14:00:57 +0100
commit880c9768a9323800ca8d44cc4b73e92278e58743 (patch)
treecf5b0b340e7a02bff8e13ae364901b324114228b /src/util/string.h
parent83d09ffaf688aac9f2de67d06420572e4d0664dc (diff)
parent437d01196899f85bbc77d71123018aa26be337da (diff)
downloaddragonfireclient-880c9768a9323800ca8d44cc4b73e92278e58743.tar.xz
Merge branch 'master' of https://github.com/minetest/minetest
Diffstat (limited to 'src/util/string.h')
-rw-r--r--src/util/string.h10
1 files changed, 7 insertions, 3 deletions
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();