diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-01-03 10:45:13 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-01-03 10:45:13 +1300 |
commit | 46f05634aeeff470743e2bf73f9299dbe9fdc44d (patch) | |
tree | d86c8683f3867e3a6b55e40ed9801b0d751cc6aa /src/org/traccar/protocol | |
parent | fc002d6133338c8b0adc1f9ea149a75be7f03e4f (diff) | |
download | traccar-server-46f05634aeeff470743e2bf73f9299dbe9fdc44d.tar.gz traccar-server-46f05634aeeff470743e2bf73f9299dbe9fdc44d.tar.bz2 traccar-server-46f05634aeeff470743e2bf73f9299dbe9fdc44d.zip |
Specify locale for number formatting
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/WatchProtocolEncoder.java | 4 |
1 files changed, 3 insertions, 1 deletions
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); } |