From 60e89dd2c5963de04b9c5b6cc64cfa1cf9f0560d Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 20 Jul 2023 17:44:10 +0100 Subject: [PATCH] Fixed commas placeholder --- .../src/main/kotlin/com/willfp/ecobits/currencies/Currency.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 068b365..3ea6f19 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,7 +192,8 @@ fun BigDecimal.formatWithExtension(): 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 {