From d8d0badd698d81ab916e0498de26158777ccbf23 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 13 Jan 2023 19:52:40 +0100 Subject: Now formatInteger accepts Long too. --- .../skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt | 2 +- src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt index 9118ac6a2..aca78fd0a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt @@ -74,7 +74,7 @@ enum class ItemAbility( } else { duration /= 1000 duration++ - LorenzUtils.formatInteger(duration.toInt()) + LorenzUtils.formatInteger(duration) } } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt index 043978277..9d783ce86 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt @@ -117,7 +117,9 @@ object LorenzUtils { fun formatPercentage(percentage: Double, format: String?): String = DecimalFormat(format).format(percentage * 100).replace(',', '.') + "%" - fun formatInteger(i: Int): String = DecimalFormat("#,##0").format(i.toLong()).replace(',', '.') + fun formatInteger(i: Int): String = formatInteger(i.toLong()) + + fun formatInteger(l: Long): String = DecimalFormat("#,##0").format(l).replace(',', '.') fun formatDouble(d: Double, format: String?): String = DecimalFormat(format).format(d).replace(',', 'x').replace('.', ',').replace('x', '.') -- cgit