diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-13 19:52:40 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-01-13 19:52:40 +0100 |
commit | d8d0badd698d81ab916e0498de26158777ccbf23 (patch) | |
tree | 08cd31e6cf3e1e36e51ac3aea4ff523c031b746a /src/main/java/at | |
parent | e0e473e47453a3d7de37e0fd71e6f08a65ccc9f0 (diff) | |
download | skyhanni-d8d0badd698d81ab916e0498de26158777ccbf23.tar.gz skyhanni-d8d0badd698d81ab916e0498de26158777ccbf23.tar.bz2 skyhanni-d8d0badd698d81ab916e0498de26158777ccbf23.zip |
Now formatInteger accepts Long too.
Diffstat (limited to 'src/main/java/at')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/itemabilities/abilitycooldown/ItemAbility.kt | 2 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt | 4 |
2 files changed, 4 insertions, 2 deletions
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', '.') |