mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-06 12:33:03 +00:00
Round to gc output to 2 dp.
This commit is contained in:
parent
470f4c1b3e
commit
b0e165546e
1 changed files with 3 additions and 3 deletions
|
@ -11,7 +11,7 @@ import net.ess3.api.IEssentials;
|
||||||
|
|
||||||
public class NumberUtil
|
public class NumberUtil
|
||||||
{
|
{
|
||||||
static DecimalFormat threeDPlaces = new DecimalFormat("#,###.###");
|
static DecimalFormat twoDPlaces = new DecimalFormat("#,###.##");
|
||||||
static DecimalFormat currencyFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
|
static DecimalFormat currencyFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
|
||||||
|
|
||||||
public static String shortCurrency(final BigDecimal value, final IEssentials ess)
|
public static String shortCurrency(final BigDecimal value, final IEssentials ess)
|
||||||
|
@ -21,8 +21,8 @@ public class NumberUtil
|
||||||
|
|
||||||
public static String formatDouble(final double value)
|
public static String formatDouble(final double value)
|
||||||
{
|
{
|
||||||
threeDPlaces.setRoundingMode(RoundingMode.HALF_UP);
|
twoDPlaces.setRoundingMode(RoundingMode.HALF_UP);
|
||||||
return threeDPlaces.format(value);
|
return twoDPlaces.format(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String formatAsCurrency(final BigDecimal value)
|
public static String formatAsCurrency(final BigDecimal value)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue