mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-06-26 17:20:03 +00:00
Implement configurable currency formatting.
This commit enables users of different countries around the world to configure currency formatting displayed to users in a familiar manner. Prior to this commit US formatting (symbols) was forced upon users. This is now configurable via locale values e.g. en-US, de, fr-ch. This commit adds two new configurations: - currency-format - currency-symbol-format-locale One method ISettings#getCurrencyFormat()
This commit is contained in:
parent
a267fb16b8
commit
282ec81af1
4 changed files with 75 additions and 0 deletions
|
@ -15,6 +15,9 @@ import static com.earth2me.essentials.I18n.tl;
|
|||
public class NumberUtil {
|
||||
static DecimalFormat twoDPlaces = new DecimalFormat("#,###.##");
|
||||
static DecimalFormat currencyFormat = new DecimalFormat("#0.00", DecimalFormatSymbols.getInstance(Locale.US));
|
||||
|
||||
// This field is likely to be modified in com.earth2me.essentials.Settings when loading currency format.
|
||||
// This ensures that we can supply a constant formatting.
|
||||
static final NumberFormat PRETTY_FORMAT = NumberFormat.getInstance(Locale.US);
|
||||
|
||||
static {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue