Issue 15149

Interpret Doubles independent of locale

15149
Reporter: kbraak
Type: Improvement
Summary: Interpret Doubles independent of locale
Priority: Critical
Resolution: WontFix
Status: Resolved
Created: 2014-02-20 14:38:57.759
Updated: 2015-11-10 19:38:19.99
Resolved: 2015-11-10 19:38:19.896
        
Description: As of Java 7, Double.parseDouble() expects the value being passed to it to be in English format/locale (with a period, not a comma). This article explains this nicely: http://rwatsh.blogspot.dk/2013/03/java-7-locale-changes-impacting.html

The following DwC fields can have decimal values:

decimalLongitude;
decimalLatitude;
coordinatePrecision;
maximumElevationInMeters
minimumElevationInMeters
maximumDepthInMeters
minimumDepthInMeters

Therefore, we need to ensure that our interpreters for all these fields can parse decimals in both formats (with a period and with a comma).

Relates to an issue encountered in the IPT, see: https://code.google.com/p/gbif-providertoolkit/issues/detail?id=1043]]>
    


Author: kbraak@gbif.org
Created: 2015-11-10 19:38:19.977
Updated: 2015-11-10 19:38:19.977
        
Marking as won't fix, because https://github.com/gbif/parsers/blob/master/src/main/java/org/gbif/common/parsers/geospatial/CoordinateParseUtils.java#L64

uses

https://github.com/gbif/parsers/blob/master/src/main/java/org/gbif/common/parsers/NumberParser.java#L11

which states:

 * Utils class to parse numbers trying various locales so that dots and comma based formats are both supported.