diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt index 5cf3ec2e5..34b86f63e 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/TimeUtils.kt @@ -34,6 +34,11 @@ object TimeUtils { val largestNonZeroUnit = parts.firstNotNullOfOrNull { if (it.value != 0) it.key else null } ?: TimeUnit.SECOND + if (absoluteValue < 1.seconds) { + val formattedMillis = (millis / 100).toInt() + return "0.${formattedMillis}s" + } + var currentUnits = 0 val result = buildString { for ((unit, value) in parts) { |