Fix number formatting for different system locale

This commit is contained in:
Sarah 2015-07-09 03:45:57 +02:00
parent 2ad2c20aaf
commit 5babd8a41a

View File

@ -1,6 +1,9 @@
package mineplex.core.common.util; package mineplex.core.common.util;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;
import java.util.Random; import java.util.Random;
import org.bukkit.Location; import org.bukkit.Location;
@ -16,7 +19,8 @@ public class UtilMath
for (int i=1 ; i<degree ; i++) for (int i=1 ; i<degree ; i++)
format += "#"; format += "#";
DecimalFormat twoDForm = new DecimalFormat(format); DecimalFormatSymbols symb = new DecimalFormatSymbols(Locale.US);
DecimalFormat twoDForm = new DecimalFormat(format, symb);
return Double.valueOf(twoDForm.format(d)); return Double.valueOf(twoDForm.format(d));
} }