9
0
mirror of https://github.com/Auxilor/EcoBits.git synced 2025-12-19 15:09:19 +00:00

Fixed commas placeholder

This commit is contained in:
Auxilor
2023-07-20 17:44:10 +01:00
parent 7ae5867d4c
commit 60e89dd2c5

View File

@@ -192,7 +192,8 @@ fun BigDecimal.formatWithExtension(): String {
} }
fun BigDecimal.formatWithCommas(): String { fun BigDecimal.formatWithCommas(): String {
return DecimalFormat("#,###.00").format(this) val decimalFormat = if (this.scale() > 0) DecimalFormat("#,###.00") else DecimalFormat("#,###")
return decimalFormat.format(this)
} }
fun OfflinePlayer.getBalance(currency: Currency): BigDecimal { fun OfflinePlayer.getBalance(currency: Currency): BigDecimal {