From 769722ddb4fe85cf17fb4a0bbc30da0202d612a1 Mon Sep 17 00:00:00 2001 From: Trent Hensler Date: Tue, 2 Jan 2018 01:37:12 -0800 Subject: [PATCH] Add decimal format for showing money to TL file --- .../java/com/massivecraft/factions/integration/Econ.java | 6 +++--- src/main/java/com/massivecraft/factions/zcore/util/TL.java | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/integration/Econ.java b/src/main/java/com/massivecraft/factions/integration/Econ.java index 951496d4..52e1bc64 100644 --- a/src/main/java/com/massivecraft/factions/integration/Econ.java +++ b/src/main/java/com/massivecraft/factions/integration/Econ.java @@ -8,6 +8,7 @@ import com.massivecraft.factions.iface.EconomyParticipator; import com.massivecraft.factions.struct.Permission; import com.massivecraft.factions.struct.Role; import com.massivecraft.factions.util.RelationUtil; +import com.massivecraft.factions.zcore.util.TL; import net.milkbowl.vault.economy.Economy; import net.milkbowl.vault.economy.EconomyResponse; import org.bukkit.Bukkit; @@ -340,9 +341,8 @@ public class Econ { } } - // format money string based on server's set currency type, like "24 gold" or "$24.50" public static String moneyString(double amount) { - return econ.format(amount); + return format.format(amount); } // calculate the cost for claiming land @@ -387,7 +387,7 @@ public class Econ { return econ.getBalance(account); } - private static final DecimalFormat format = new DecimalFormat("#,###"); + private static final DecimalFormat format = new DecimalFormat(TL.ECON_FORMAT.toString()); public static String getFriendlyBalance(UUID uuid) { OfflinePlayer offline = Bukkit.getOfflinePlayer(uuid); diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index c709ef7b..ec1a9581 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -629,6 +629,7 @@ public enum TL { */ ECON_OFF("no %s"), // no balance, no value, no refund, etc + ECON_FORMAT("###,###.###"), /** * Relations