mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-24 11:15:21 +01:00
Merge pull request #3133 from electron93/fix-comma
Fix comma on some locales when formatting float and double values
This commit is contained in:
commit
56076f44ef
@ -4,6 +4,7 @@ import java.lang.reflect.Array;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
public class Json {
|
||||
@ -69,7 +70,7 @@ public class Json {
|
||||
} else if (o instanceof Integer || o instanceof Long) {
|
||||
s.append(o.toString());
|
||||
} else if (o instanceof Float || o instanceof Double) {
|
||||
s.append(String.format("%.2f",((Number)o).doubleValue()));
|
||||
s.append(String.format(Locale.US, "%.2f",((Number)o).doubleValue()));
|
||||
} else if (o instanceof Map<?, ?>) {
|
||||
Map<?, ?> m = (Map<?, ?>) o;
|
||||
s.append("{");
|
||||
|
Loading…
Reference in New Issue
Block a user