The ExtTypeAttributes which are used for marine maps should have a problem if the locale of the system does not use english number formatting (e.g. german uses "," as decimal separator).

Attached patch fixes that. I cannot test it because the code is only executed with polish input files using the attribute "HeightAboveFoundation".

Please test if you are able to reproduce.

WanMil
Index: src/uk/me/parabola/imgfmt/app/trergn/ExtTypeAttributes.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/trergn/ExtTypeAttributes.java	(revision 2442)
+++ src/uk/me/parabola/imgfmt/app/trergn/ExtTypeAttributes.java	(working copy)
@@ -17,10 +17,12 @@
 package uk.me.parabola.imgfmt.app.trergn;
 
 import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
 import java.text.ParsePosition;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import uk.me.parabola.imgfmt.app.Label;
@@ -878,7 +880,7 @@
 
 	private Integer parseDistance(String ds, boolean[] flags) {
 		ParsePosition pp = new ParsePosition(0);
-		Number dn = new DecimalFormat().parse(ds, pp);
+		Number dn = new DecimalFormat("0.0", DecimalFormatSymbols.getInstance(Locale.US)).parse(ds, pp);
 		if(dn != null) {
 			double dd = dn.doubleValue();
 			int di = dn.intValue();
_______________________________________________
mkgmap-dev mailing list
[email protected]
http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to