mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-24 06:35:46 +00:00
Handle different Locale when formatting
(ex: 26353,394 instead of 26353.394, which will eventually cause a ANR when formatting)
This commit is contained in:
parent
8518ec5802
commit
2c53b68b5f
1 changed files with 3 additions and 1 deletions
|
|
@ -23,7 +23,9 @@ object NumberAbbreviator {
|
|||
if (decimalCount > 0) {
|
||||
pattern = ("$pattern.").padEnd(4 + decimalCount, '#')
|
||||
}
|
||||
val formatter = DecimalFormat(pattern + abbreviationForCounter(context, counter).replace(".", ""))
|
||||
val formatter = DecimalFormat(pattern + abbreviationForCounter(context, counter)
|
||||
.replace(".", "")
|
||||
.replace(",", ""))
|
||||
formatter.roundingMode = RoundingMode.FLOOR
|
||||
return formatter.format(usedNumber)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue