From e558e7365a8f44b32ae8ebf96bd0f525958a2c20 Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Tue, 25 Jul 2023 17:16:50 -0400 Subject: [PATCH] Fix trade signs not working with currency suffix (#5441) --- .../main/java/com/earth2me/essentials/signs/SignTrade.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/signs/SignTrade.java b/Essentials/src/main/java/com/earth2me/essentials/signs/SignTrade.java index 3bfa4848c..cd27f501d 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/signs/SignTrade.java +++ b/Essentials/src/main/java/com/earth2me/essentials/signs/SignTrade.java @@ -179,7 +179,7 @@ public class SignTrade extends EssentialsSign { if (amount.compareTo(MINTRANSACTION) < 0 || money.compareTo(MINTRANSACTION) < 0) { throw new SignException(tl("moreThanZero")); } - final String newLine = NumberUtil.shortCurrency(money, ess) + ":" + NumberUtil.shortCurrency(amount, ess).substring(1); + final String newLine = NumberUtil.shortCurrency(money, ess) + ":" + NumberUtil.formatAsCurrency(amount); validateSignLength(newLine); sign.setLine(index, newLine); return; @@ -333,7 +333,7 @@ public class SignTrade extends EssentialsSign { final BigDecimal money = getMoney(split[0], ess); final BigDecimal amount = getBigDecimal(split[1], ess); if (money != null && amount != null) { - final String newline = NumberUtil.shortCurrency(money, ess) + ":" + NumberUtil.shortCurrency(value, ess).substring(1); + final String newline = NumberUtil.shortCurrency(money, ess) + ":" + NumberUtil.formatAsCurrency(value); validateSignLength(newline); sign.setLine(index, newline); return;