mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-06-26 01:00:25 +00:00
Replace Reflection with setter implementation
This commit is contained in:
parent
d24fbc9f55
commit
c7000846cd
2 changed files with 8 additions and 17 deletions
|
@ -11,8 +11,8 @@ import java.util.Locale;
|
|||
|
||||
import static com.earth2me.essentials.I18n.tl;
|
||||
|
||||
|
||||
public class NumberUtil {
|
||||
|
||||
private static DecimalFormat twoDPlaces = new DecimalFormat("#,###.##");
|
||||
private static DecimalFormat currencyFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
|
||||
|
||||
|
@ -30,6 +30,11 @@ public class NumberUtil {
|
|||
PRETTY_FORMAT.setMaximumFractionDigits(2);
|
||||
}
|
||||
|
||||
// this method should only be called by Essentials
|
||||
public static void internalSetPrettyFormat(NumberFormat prettyFormat) {
|
||||
PRETTY_FORMAT = prettyFormat;
|
||||
}
|
||||
|
||||
public static String shortCurrency(final BigDecimal value, final IEssentials ess) {
|
||||
return ess.getSettings().getCurrencySymbol() + formatAsCurrency(value);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue