diff options
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt b/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt index dc7c4828c..b05275151 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt @@ -241,7 +241,9 @@ object NumberUtil { return@run null } - private fun String.formatDoubleOrNull(): Double? { + fun String.formatIntOrNull(): Int? = formatDoubleOrNull()?.toInt() + + fun String.formatDoubleOrNull(): Double? { var text = lowercase().replace(",", "") val multiplier = if (text.endsWith("k")) { |