Skip to content

Commit

Permalink
use US locale for double formatting, should fix #1775.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwigway committed Feb 26, 2015
1 parent 1e69e15 commit 6b1db75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/conveyal/gtfs/model/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.net.MalformedURLException;
import java.nio.charset.Charset;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.zip.ZipEntry;
Expand Down Expand Up @@ -389,8 +390,9 @@ protected void writeDoubleField (double val) throws IOException {
// This is usually used for coordinates; one ten-millionth of a degree at the equator is 1.1cm,
// and smaller elsewhere on earth, plenty precise enough.
// On Jupiter, however, it's a different story.
// Use the US locale so that . is used as the decimal separator
else
writeStringField(String.format("%.7f", val));
writeStringField(String.format(Locale.US, "%.7f", val));
}

/**
Expand Down

0 comments on commit 6b1db75

Please sign in to comment.