From 46f05634aeeff470743e2bf73f9299dbe9fdc44d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 3 Jan 2017 10:45:13 +1300 Subject: Specify locale for number formatting --- src/org/traccar/protocol/WatchProtocolEncoder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/protocol/WatchProtocolEncoder.java b/src/org/traccar/protocol/WatchProtocolEncoder.java index f394034d3..c5d8fad86 100644 --- a/src/org/traccar/protocol/WatchProtocolEncoder.java +++ b/src/org/traccar/protocol/WatchProtocolEncoder.java @@ -22,7 +22,9 @@ import org.traccar.model.Command; import javax.xml.bind.DatatypeConverter; import java.nio.charset.StandardCharsets; import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; import java.util.HashMap; +import java.util.Locale; import java.util.Map; public class WatchProtocolEncoder extends StringProtocolEncoder implements StringProtocolEncoder.ValueFormatter { @@ -31,7 +33,7 @@ public class WatchProtocolEncoder extends StringProtocolEncoder implements Strin public String formatValue(String key, Object value) { if (key.equals(Command.KEY_TIMEZONE)) { double offset = ((Number) value).longValue() / 3600.0; - DecimalFormat fmt = new DecimalFormat("+#.##;-#.##"); + DecimalFormat fmt = new DecimalFormat("+#.##;-#.##", DecimalFormatSymbols.getInstance(Locale.US)); return fmt.format(offset); } -- cgit v1.2.3