mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-03-09 21:29:20 +01:00
Fix mini message parsing in NumberUtil#displayCurrency (#5921)
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
This commit is contained in:
parent
1af1565059
commit
bea43e8798
@ -2,6 +2,7 @@ package com.earth2me.essentials;
|
||||
|
||||
import com.earth2me.essentials.craftbukkit.Inventories;
|
||||
import com.earth2me.essentials.craftbukkit.SetExpFix;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.earth2me.essentials.utils.VersionUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
@ -191,7 +192,7 @@ public class Trade {
|
||||
}
|
||||
|
||||
if (getMoney() != null && getMoney().signum() > 0 && !user.canAfford(getMoney())) {
|
||||
future.completeExceptionally(new ChargeException("notEnoughMoney", NumberUtil.displayCurrency(getMoney(), ess)));
|
||||
future.completeExceptionally(new ChargeException("notEnoughMoney", AdventureUtil.parsed(NumberUtil.displayCurrency(getMoney(), ess))));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -202,7 +203,7 @@ public class Trade {
|
||||
|
||||
final BigDecimal money;
|
||||
if (command != null && !command.isEmpty() && (money = getCommandCost(user)).signum() > 0 && !user.canAfford(money)) {
|
||||
future.completeExceptionally(new ChargeException("notEnoughMoney", NumberUtil.displayCurrency(money, ess)));
|
||||
future.completeExceptionally(new ChargeException("notEnoughMoney", AdventureUtil.parsed(NumberUtil.displayCurrency(money, ess))));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -285,7 +286,7 @@ public class Trade {
|
||||
ess.getLogger().log(Level.INFO, "charging user " + user.getName() + " money " + getMoney().toPlainString());
|
||||
}
|
||||
if (!user.canAfford(getMoney()) && getMoney().signum() > 0) {
|
||||
future.completeExceptionally(new ChargeException("notEnoughMoney", NumberUtil.displayCurrency(getMoney(), ess)));
|
||||
future.completeExceptionally(new ChargeException("notEnoughMoney", AdventureUtil.parsed(NumberUtil.displayCurrency(getMoney(), ess))));
|
||||
return;
|
||||
}
|
||||
user.takeMoney(getMoney());
|
||||
@ -304,7 +305,7 @@ public class Trade {
|
||||
if (command != null) {
|
||||
final BigDecimal cost = getCommandCost(user);
|
||||
if (!user.canAfford(cost) && cost.signum() > 0) {
|
||||
future.completeExceptionally(new ChargeException("notEnoughMoney", NumberUtil.displayCurrency(cost, ess)));
|
||||
future.completeExceptionally(new ChargeException("notEnoughMoney", AdventureUtil.parsed(NumberUtil.displayCurrency(cost, ess))));
|
||||
return;
|
||||
}
|
||||
user.takeMoney(cost);
|
||||
|
@ -247,9 +247,9 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
|
||||
return;
|
||||
}
|
||||
setMoney(getMoney().add(value), cause);
|
||||
sendTl("addedToAccount", NumberUtil.displayCurrency(value, ess));
|
||||
sendTl("addedToAccount", AdventureUtil.parsed(NumberUtil.displayCurrency(value, ess)));
|
||||
if (initiator != null) {
|
||||
initiator.sendTl("addedToOthersAccount", NumberUtil.displayCurrency(value, ess), getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess));
|
||||
initiator.sendTl("addedToOthersAccount", AdventureUtil.parsed(NumberUtil.displayCurrency(value, ess)), getDisplayName(), AdventureUtil.parsed(NumberUtil.displayCurrency(getMoney(), ess)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,12 +266,12 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
|
||||
if (canAfford(value)) {
|
||||
setMoney(getMoney().subtract(value), cause);
|
||||
reciever.setMoney(reciever.getMoney().add(value), cause);
|
||||
sendTl("moneySentTo", NumberUtil.displayCurrency(value, ess), reciever.getDisplayName());
|
||||
reciever.sendTl("moneyRecievedFrom", NumberUtil.displayCurrency(value, ess), getDisplayName());
|
||||
sendTl("moneySentTo", AdventureUtil.parsed(NumberUtil.displayCurrency(value, ess)), reciever.getDisplayName());
|
||||
reciever.sendTl("moneyRecievedFrom", AdventureUtil.parsed(NumberUtil.displayCurrency(value, ess)), getDisplayName());
|
||||
final TransactionEvent transactionEvent = new TransactionEvent(this.getSource(), reciever, value);
|
||||
ess.getServer().getPluginManager().callEvent(transactionEvent);
|
||||
} else {
|
||||
throw new ChargeException("notEnoughMoney", NumberUtil.displayCurrency(value, ess));
|
||||
throw new ChargeException("notEnoughMoney", AdventureUtil.parsed(NumberUtil.displayCurrency(value, ess)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,9 +294,9 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
|
||||
} catch (final MaxMoneyException ex) {
|
||||
ess.getLogger().log(Level.WARNING, "Invalid call to takeMoney, total balance can't be more than the max-money limit.", ex);
|
||||
}
|
||||
sendTl("takenFromAccount", NumberUtil.displayCurrency(value, ess));
|
||||
sendTl("takenFromAccount", AdventureUtil.parsed(NumberUtil.displayCurrency(value, ess)));
|
||||
if (initiator != null) {
|
||||
initiator.sendTl("takenFromOthersAccount", NumberUtil.displayCurrency(value, ess), getDisplayName(), NumberUtil.displayCurrency(getMoney(), ess));
|
||||
initiator.sendTl("takenFromOthersAccount", AdventureUtil.parsed(NumberUtil.displayCurrency(value, ess)), getDisplayName(), AdventureUtil.parsed(NumberUtil.displayCurrency(getMoney(), ess)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import org.bukkit.Server;
|
||||
|
||||
@ -20,16 +21,16 @@ public class Commandbalance extends EssentialsCommand {
|
||||
}
|
||||
|
||||
final User target = getPlayer(server, args, 0, false, true);
|
||||
sender.sendTl("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(target.getMoney(), ess));
|
||||
sender.sendTl("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), AdventureUtil.parsed(NumberUtil.displayCurrency(target.getMoney(), ess)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
|
||||
if (args.length == 1 && user.isAuthorized("essentials.balance.others")) {
|
||||
final User target = getPlayer(server, args, 0, true, true);
|
||||
user.sendTl("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), NumberUtil.displayCurrency(target.getMoney(), ess));
|
||||
user.sendTl("balanceOther", target.isHidden() ? target.getName() : target.getDisplayName(), AdventureUtil.parsed(NumberUtil.displayCurrency(target.getMoney(), ess)));
|
||||
} else if (args.length < 2) {
|
||||
user.sendTl("balance", NumberUtil.displayCurrency(user.getMoney(), ess));
|
||||
user.sendTl("balance", AdventureUtil.parsed(NumberUtil.displayCurrency(user.getMoney(), ess)));
|
||||
} else {
|
||||
throw new NotEnoughArgumentsException();
|
||||
}
|
||||
|
@ -110,11 +110,11 @@ public class Commandbalancetop extends EssentialsCommand {
|
||||
future.thenRun(() -> {
|
||||
if (fresh) {
|
||||
final SimpleTextInput newCache = new SimpleTextInput();
|
||||
newCache.getLines().add(AdventureUtil.miniToLegacy(tlLiteral("serverTotal", NumberUtil.displayCurrency(ess.getBalanceTop().getBalanceTopTotal(), ess))));
|
||||
newCache.getLines().add(AdventureUtil.miniToLegacy(tlLiteral("serverTotal", AdventureUtil.parsed(NumberUtil.displayCurrency(ess.getBalanceTop().getBalanceTopTotal(), ess)))));
|
||||
int pos = 1;
|
||||
for (final Map.Entry<UUID, BalanceTop.Entry> entry : ess.getBalanceTop().getBalanceTopCache().entrySet()) {
|
||||
if (ess.getSettings().showZeroBaltop() || entry.getValue().getBalance().compareTo(BigDecimal.ZERO) > 0) {
|
||||
newCache.getLines().add(AdventureUtil.miniToLegacy(tlLiteral("balanceTopLine", pos, entry.getValue().getDisplayName(), NumberUtil.displayCurrency(entry.getValue().getBalance(), ess))));
|
||||
newCache.getLines().add(AdventureUtil.miniToLegacy(tlLiteral("balanceTopLine", pos, entry.getValue().getDisplayName(), AdventureUtil.parsed(NumberUtil.displayCurrency(entry.getValue().getBalance(), ess)))));
|
||||
}
|
||||
pos++;
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.ChargeException;
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.ess3.api.MaxMoneyException;
|
||||
@ -53,7 +54,7 @@ public class Commandeco extends EssentialsLoopCommand {
|
||||
if (player.getMoney().subtract(userAmount).compareTo(ess.getSettings().getMinMoney()) >= 0) {
|
||||
player.takeMoney(userAmount, sender, UserBalanceUpdateEvent.Cause.COMMAND_ECO);
|
||||
} else {
|
||||
ess.showError(sender, new TranslatableException("minimumBalanceError", NumberUtil.displayCurrency(ess.getSettings().getMinMoney(), ess)), commandLabel);
|
||||
ess.showError(sender, new TranslatableException("minimumBalanceError", AdventureUtil.parsed(NumberUtil.displayCurrency(ess.getSettings().getMinMoney(), ess))), commandLabel);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -64,8 +65,8 @@ public class Commandeco extends EssentialsLoopCommand {
|
||||
final boolean underMin = userAmount.compareTo(minBal) < 0;
|
||||
final boolean aboveMax = userAmount.compareTo(maxBal) > 0;
|
||||
player.setMoney(underMin ? minBal : aboveMax ? maxBal : userAmount, UserBalanceUpdateEvent.Cause.COMMAND_ECO);
|
||||
player.sendTl("setBal", NumberUtil.displayCurrency(player.getMoney(), ess));
|
||||
sender.sendTl("setBalOthers", player.getDisplayName(), NumberUtil.displayCurrency(player.getMoney(), ess));
|
||||
player.sendTl("setBal", AdventureUtil.parsed(NumberUtil.displayCurrency(player.getMoney(), ess)));
|
||||
sender.sendTl("setBalOthers", player.getDisplayName(), AdventureUtil.parsed(NumberUtil.displayCurrency(player.getMoney(), ess)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.Trade;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.earth2me.essentials.utils.StringUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
@ -70,7 +71,7 @@ public class Commandpay extends EssentialsLoopCommand {
|
||||
final BigDecimal amount = tempAmount;
|
||||
|
||||
if (amount.compareTo(ess.getSettings().getMinimumPayAmount()) < 0) { // Check if amount is less than minimum-pay-amount
|
||||
throw new TranslatableException("minimumPayAmount", NumberUtil.displayCurrencyExactly(ess.getSettings().getMinimumPayAmount(), ess));
|
||||
throw new TranslatableException("minimumPayAmount", AdventureUtil.parsed(NumberUtil.displayCurrencyExactly(ess.getSettings().getMinimumPayAmount(), ess)));
|
||||
}
|
||||
final AtomicBoolean informToConfirm = new AtomicBoolean(false);
|
||||
final boolean canPayOffline = user.isAuthorized("essentials.pay.offline");
|
||||
@ -117,7 +118,7 @@ public class Commandpay extends EssentialsLoopCommand {
|
||||
});
|
||||
if (informToConfirm.get()) {
|
||||
final String cmd = "/" + commandLabel + " " + StringUtil.joinList(" ", args);
|
||||
user.sendTl("confirmPayment", NumberUtil.displayCurrency(amount, ess), cmd);
|
||||
user.sendTl("confirmPayment", AdventureUtil.parsed(NumberUtil.displayCurrency(amount, ess)), cmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ public class Commandsell extends EssentialsCommand {
|
||||
ess.showError(user.getSource(), new TranslatableException("cannotSellTheseNamedItems", String.join(ChatColor.RESET + ", ", names)), commandLabel);
|
||||
}
|
||||
if (count != 1) {
|
||||
final String totalWorthStr = NumberUtil.displayCurrency(totalWorth, ess);
|
||||
final AdventureUtil.ParsedPlaceholder totalWorthStr = AdventureUtil.parsed(NumberUtil.displayCurrency(totalWorth, ess));
|
||||
if (args[0].equalsIgnoreCase("blocks")) {
|
||||
user.sendTl("totalWorthBlocks", totalWorthStr, totalWorthStr);
|
||||
} else {
|
||||
@ -101,7 +101,7 @@ public class Commandsell extends EssentialsCommand {
|
||||
|
||||
if (amount <= 0) {
|
||||
if (!isBulkSell) {
|
||||
user.sendTl("itemSold", NumberUtil.displayCurrency(BigDecimal.ZERO, ess), BigDecimal.ZERO, is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(worth, ess));
|
||||
user.sendTl("itemSold", AdventureUtil.parsed(NumberUtil.displayCurrency(BigDecimal.ZERO, ess)), BigDecimal.ZERO, is.getType().toString().toLowerCase(Locale.ENGLISH), NumberUtil.displayCurrency(worth, ess));
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
@ -120,9 +120,9 @@ public class Commandsell extends EssentialsCommand {
|
||||
Trade.log("Command", "Sell", "Item", user.getName(), new Trade(ris, ess), user.getName(), new Trade(result, ess), user.getLocation(), user.getMoney(), ess);
|
||||
user.giveMoney(result, null, UserBalanceUpdateEvent.Cause.COMMAND_SELL);
|
||||
final String typeName = is.getType().toString().toLowerCase(Locale.ENGLISH);
|
||||
final String worthDisplay = NumberUtil.displayCurrency(worth, ess);
|
||||
user.sendTl("itemSold", NumberUtil.displayCurrency(result, ess), amount, typeName, worthDisplay);
|
||||
ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("itemSoldConsole", user.getName(), typeName, NumberUtil.displayCurrency(result, ess), amount, worthDisplay, user.getDisplayName())));
|
||||
final AdventureUtil.ParsedPlaceholder worthDisplay = AdventureUtil.parsed(NumberUtil.displayCurrency(worth, ess));
|
||||
user.sendTl("itemSold", AdventureUtil.parsed(NumberUtil.displayCurrency(result, ess)), amount, typeName, worthDisplay);
|
||||
ess.getLogger().log(Level.INFO, AdventureUtil.miniToLegacy(tlLiteral("itemSoldConsole", user.getName(), typeName, AdventureUtil.miniToLegacy(NumberUtil.displayCurrency(result, ess)), amount, AdventureUtil.miniToLegacy(worthDisplay.toString()), user.getDisplayName())));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ public class Commandwhois extends EssentialsCommand {
|
||||
final long playtimeMs = System.currentTimeMillis() - (user.getBase().getStatistic(PLAY_ONE_TICK) * 50L);
|
||||
sender.sendTl("whoisPlaytime", DateUtil.formatDateDiff(playtimeMs));
|
||||
if (!ess.getSettings().isEcoDisabled()) {
|
||||
sender.sendTl("whoisMoney", NumberUtil.displayCurrency(user.getMoney(), ess));
|
||||
sender.sendTl("whoisMoney", AdventureUtil.parsed(NumberUtil.displayCurrency(user.getMoney(), ess)));
|
||||
}
|
||||
if (!sender.isPlayer() || ess.getUser(sender.getPlayer()).isAuthorized("essentials.whois.ip")) {
|
||||
sender.sendTl("whoisIPAddress", user.getBase().getAddress().getAddress().toString());
|
||||
|
@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
|
||||
|
||||
import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.MaterialUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
@ -45,7 +46,7 @@ public class Commandworth extends EssentialsCommand {
|
||||
}
|
||||
}
|
||||
if (count > 1) {
|
||||
final String totalWorthStr = NumberUtil.displayCurrency(totalWorth, ess);
|
||||
final AdventureUtil.ParsedPlaceholder totalWorthStr = AdventureUtil.parsed(NumberUtil.displayCurrency(totalWorth, ess));
|
||||
if (args.length > 0 && args[0].equalsIgnoreCase("blocks")) {
|
||||
user.sendTl("totalSellableBlocks", totalWorthStr, totalWorthStr);
|
||||
return;
|
||||
@ -88,8 +89,8 @@ public class Commandworth extends EssentialsCommand {
|
||||
|
||||
final BigDecimal result = worth.multiply(BigDecimal.valueOf(amount));
|
||||
final String typeName = is.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
|
||||
final String resultDisplay = NumberUtil.displayCurrency(result, ess);
|
||||
final String worthDisplay = NumberUtil.displayCurrency(worth, ess);
|
||||
final AdventureUtil.ParsedPlaceholder resultDisplay = AdventureUtil.parsed(NumberUtil.displayCurrency(result, ess));
|
||||
final AdventureUtil.ParsedPlaceholder worthDisplay = AdventureUtil.parsed(NumberUtil.displayCurrency(worth, ess));
|
||||
if (MaterialUtil.getDamage(is) != 0) {
|
||||
sender.sendTl("worthMeta", typeName, MaterialUtil.getDamage(is), resultDisplay, amount, worthDisplay);
|
||||
} else {
|
||||
|
@ -5,6 +5,7 @@ import com.earth2me.essentials.OfflinePlayerStub;
|
||||
import com.earth2me.essentials.api.NoLoanPermittedException;
|
||||
import com.earth2me.essentials.api.UserDoesNotExistException;
|
||||
import com.earth2me.essentials.config.EssentialsUserConfiguration;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import com.earth2me.essentials.utils.StringUtil;
|
||||
import com.google.common.base.Charsets;
|
||||
@ -61,7 +62,7 @@ public class VaultEconomyProvider implements Economy {
|
||||
|
||||
@Override
|
||||
public String format(double amount) {
|
||||
return NumberUtil.displayCurrency(BigDecimal.valueOf(amount), ess);
|
||||
return AdventureUtil.miniToLegacy(NumberUtil.displayCurrency(BigDecimal.valueOf(amount), ess));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.earth2me.essentials.signs;
|
||||
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.NumberUtil;
|
||||
import net.ess3.api.IEssentials;
|
||||
|
||||
@ -11,7 +12,7 @@ public class SignBalance extends EssentialsSign {
|
||||
|
||||
@Override
|
||||
protected boolean onSignInteract(final ISign sign, final User player, final String username, final IEssentials ess) throws SignException {
|
||||
player.sendTl("balance", NumberUtil.displayCurrency(player.getMoney(), ess));
|
||||
player.sendTl("balance", AdventureUtil.parsed(NumberUtil.displayCurrency(player.getMoney(), ess)));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ import com.earth2me.essentials.CommandSource;
|
||||
import com.earth2me.essentials.ExecuteTimer;
|
||||
import com.earth2me.essentials.PlayerList;
|
||||
import com.earth2me.essentials.User;
|
||||
import com.earth2me.essentials.utils.AdventureUtil;
|
||||
import com.earth2me.essentials.utils.DateUtil;
|
||||
import com.earth2me.essentials.utils.DescParseTickFormat;
|
||||
import com.earth2me.essentials.utils.EnumUtil;
|
||||
@ -227,7 +228,7 @@ public class KeywordReplacer implements IText {
|
||||
break;
|
||||
case BALANCE:
|
||||
if (user != null) {
|
||||
replacer = NumberUtil.displayCurrency(user.getMoney(), ess);
|
||||
replacer = AdventureUtil.miniToLegacy(NumberUtil.displayCurrency(user.getMoney(), ess));
|
||||
}
|
||||
break;
|
||||
case MAILS:
|
||||
|
@ -65,21 +65,22 @@ public final class NumberUtil {
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: this *can* return MiniMessage, make sure if this is sent to a player that it is wrapped in AdventureUtil#parsed.
|
||||
*/
|
||||
public static String displayCurrency(final BigDecimal value, final IEssentials ess) {
|
||||
String currency = formatAsPrettyCurrency(value);
|
||||
String sign = "";
|
||||
if (value.signum() < 0) {
|
||||
currency = currency.substring(1);
|
||||
sign = "-";
|
||||
}
|
||||
if (ess.getSettings().isCurrencySymbolSuffixed()) {
|
||||
return sign + tlLiteral("currency", currency, ess.getSettings().getCurrencySymbol());
|
||||
}
|
||||
return sign + tlLiteral("currency", ess.getSettings().getCurrencySymbol(), currency);
|
||||
return displayCurrency(value, ess, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: this *can* return MiniMessage, make sure if this is sent to a player that it is wrapped in AdventureUtil#parsed.
|
||||
*/
|
||||
public static String displayCurrencyExactly(final BigDecimal value, final IEssentials ess) {
|
||||
String currency = value.toPlainString();
|
||||
return displayCurrency(value, ess, true);
|
||||
}
|
||||
|
||||
private static String displayCurrency(final BigDecimal value, final IEssentials ess, final boolean exact) {
|
||||
String currency = exact ? value.toPlainString() : formatAsPrettyCurrency(value);
|
||||
String sign = "";
|
||||
if (value.signum() < 0) {
|
||||
currency = currency.substring(1);
|
||||
|
Loading…
Reference in New Issue
Block a user