Merge branch 'master' of github.com:AppleDash/SaneEconomy

This commit is contained in:
AppleDash 2016-10-02 10:20:36 -04:00
commit 7f5740e5f1
3 changed files with 18 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package org.appledash.saneeconomy.economy;
import org.bukkit.configuration.ConfigurationSection;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
/**
* Created by AppleDash on 6/13/2016.
@ -22,10 +23,24 @@ public class Currency {
}
public static Currency fromConfig(ConfigurationSection config) {
DecimalFormat format = new DecimalFormat(config.getString("format", "0.00"));
if (config.getInt("grouping", 0) > 0) {
DecimalFormatSymbols symbols = format.getDecimalFormatSymbols();
if (symbols.getDecimalSeparator() == ',') { // French
symbols.setGroupingSeparator(' ');
} else {
symbols.setGroupingSeparator(',');
}
format.setDecimalFormatSymbols(symbols);
format.setGroupingUsed(true);
format.setGroupingSize(3);
}
return new Currency(
config.getString("name.singular", "dollar"),
config.getString("name.plural", "dollars"),
new DecimalFormat(config.getString("format", "0.00"))
format
);
}

View File

@ -6,6 +6,7 @@ currency:
singular: dollar
plural: dollars
format: '0.00'
grouping: 3
chat:
prefix: '&b[&9Economy&b]&r '

View File

@ -1,7 +1,7 @@
# How to use this file:
# Add a translation to the messages you wish to change, like this:
# - message: That player is not online.
# translation: Ce joueur est pas en ligne.
# translation: Ce joueur n'est pas en ligne.
messages:
- message: You don't have permission to check the balance of %s.
- message: That player is not online.