diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/currencies/Currency.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/currencies/Currency.kt index 3ea6f19..542af59 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/currencies/Currency.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobits/currencies/Currency.kt @@ -192,8 +192,9 @@ fun BigDecimal.formatWithExtension(): String { } fun BigDecimal.formatWithCommas(): String { - val decimalFormat = if (this.scale() > 0) DecimalFormat("#,###.00") else DecimalFormat("#,###") - return decimalFormat.format(this) + val stripped = this.stripTrailingZeros() + val decimalFormat = if (stripped.scale() > 0) DecimalFormat("#,##0.00") else DecimalFormat("#,##0") + return decimalFormat.format(stripped) } fun OfflinePlayer.getBalance(currency: Currency): BigDecimal {