Add support for changing grouping separator.

This commit is contained in:
AppleDash 2016-12-15 17:47:26 -05:00
parent 55e58d0ac3
commit 3670ebaadd
2 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
package org.appledash.saneeconomy.economy;
import com.google.common.base.Strings;
import org.bukkit.configuration.ConfigurationSection;
import java.text.DecimalFormat;
@ -32,6 +33,13 @@ public class Currency {
} else {
symbols.setGroupingSeparator(',');
}
String groupingSeparator = config.getString("grouping-separator", null);
if (!Strings.isNullOrEmpty(groupingSeparator)) {
symbols.setGroupingSeparator(groupingSeparator.charAt(0));
}
format.setDecimalFormatSymbols(symbols);
format.setGroupingUsed(true);
format.setGroupingSize(3);

View File

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