aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-01-03 10:45:13 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-01-03 10:45:13 +1300
commit46f05634aeeff470743e2bf73f9299dbe9fdc44d (patch)
treed86c8683f3867e3a6b55e40ed9801b0d751cc6aa /src/org
parentfc002d6133338c8b0adc1f9ea149a75be7f03e4f (diff)
downloadtrackermap-server-46f05634aeeff470743e2bf73f9299dbe9fdc44d.tar.gz
trackermap-server-46f05634aeeff470743e2bf73f9299dbe9fdc44d.tar.bz2
trackermap-server-46f05634aeeff470743e2bf73f9299dbe9fdc44d.zip
Specify locale for number formatting
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/protocol/WatchProtocolEncoder.java4
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);
}