aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
index aa4126de1..7c8e68a87 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt
@@ -35,7 +35,7 @@ object StringUtils {
return builder.toString()
}
- fun formatDuration(seconds: Long): String {
+ fun formatDuration(seconds: Long, decimalFormat: Boolean = false): String {
var sec: Long = seconds
var minutes: Long = sec / 60
@@ -52,6 +52,10 @@ object StringUtils {
val formatMinutes = durationFormat.format(minutes)
val formatSeconds = durationFormat.format(sec)
+ if (decimalFormat) {
+ return "$formatMinutes:$formatSeconds"
+ }
+
if (days > 0) {
return "${days}d $formatHours:$formatMinutes:$formatSeconds"
}