Changeset 13124 in josm


Ignore:
Timestamp:
2017-11-15T20:09:06+01:00 (7 years ago)
Author:
Don-vip
Message:

fix #15552 - fix parsing of decimal numbers

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/JosmDecimalFormatSymbolsProvider.java

    r13104 r13124  
    22package org.openstreetmap.josm.tools;
    33
    4 import java.text.DecimalFormat;
    54import java.text.DecimalFormatSymbols;
    6 import java.text.NumberFormat;
    75import java.text.spi.DecimalFormatSymbolsProvider;
    86import java.util.Locale;
     
    4341     */
    4442    public static double parseDouble(String s) {
    45         String text = s;
    46         NumberFormat format = DecimalFormat.getInstance();
    47         if (format instanceof DecimalFormat) {
    48             char decimalSeparator = ((DecimalFormat) format).getDecimalFormatSymbols().getDecimalSeparator();
    49             text = text.replace('.', decimalSeparator).replace(',', decimalSeparator);
    50         }
    51         return Double.parseDouble(text);
     43        return Double.parseDouble(s.replace(',', '.'));
    5244    }
    5345}
Note: See TracChangeset for help on using the changeset viewer.