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/NumberUtil.kt7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt b/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt
index 707bb5b4d..bccf92e62 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt
@@ -189,7 +189,7 @@ object NumberUtil {
}
fun String.formatNumber(): Long {
- var text = replace(",", "")
+ var text = lowercase().replace(",", "")
val multiplier = if (text.endsWith("k")) {
text = text.substring(0, text.length - 1)
@@ -197,7 +197,10 @@ object NumberUtil {
} else if (text.endsWith("m")) {
text = text.substring(0, text.length - 1)
1_000_000
- } else 1
+ }else if (text.endsWith("b")) {
+ text = text.substring(0, text.length - 1)
+ 1_000_000_000
+ }else 1
val d = text.toDouble()
return (d * multiplier).toLong()
}