Changeset 13124 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/JosmDecimalFormatSymbolsProvider.java
r13104 r13124 2 2 package org.openstreetmap.josm.tools; 3 3 4 import java.text.DecimalFormat;5 4 import java.text.DecimalFormatSymbols; 6 import java.text.NumberFormat;7 5 import java.text.spi.DecimalFormatSymbolsProvider; 8 6 import java.util.Locale; … … 43 41 */ 44 42 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(',', '.')); 52 44 } 53 45 }
Note:
See TracChangeset
for help on using the changeset viewer.