diff --git a/src/main/java/mmo/Info/MMOInfoGold.java b/src/main/java/mmo/Info/MMOInfoGold.java index 73c5e65..5e796b9 100644 --- a/src/main/java/mmo/Info/MMOInfoGold.java +++ b/src/main/java/mmo/Info/MMOInfoGold.java @@ -16,6 +16,7 @@ */ package mmo.Info; +import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.HashMap; import java.util.Locale; @@ -115,7 +116,9 @@ public void onTick() { final String plat = numForm.format(economy.getBalance(this.getScreen().getPlayer().getName())); setText(String.format(ChatColor.WHITE + plat)); } else { - final String[] money = Double.toString((double) economy.getBalance(this.getScreen().getPlayer().getName())).split("\\."); + double moneyvalue = (double) economy.getBalance(this.getScreen().getPlayer().getName()); + NumberFormat numberformat = new DecimalFormat("0.00"); + final String[] money = numberformat.format(moneyvalue).split("\\."); setText(String.format(ChatColor.WHITE + "%s" + ChatColor.YELLOW + "g " + ChatColor.WHITE + "%s" + ChatColor.GRAY + "s", money.length > 0 ? money[0] : "0", money.length > 1 ? money[1] : "0")); } }