Here you can find the source of sanitizeDouble(String value)
public static String sanitizeDouble(String value)
//package com.java2s; // the Bio-Formats library, licensed according to Simplified BSD, as follows: import java.text.DecimalFormatSymbols; public class Main { /** Normalizes the decimal separator for the user's locale. */ public static String sanitizeDouble(String value) { value = value.replaceAll("[^0-9,\\.]", ""); final char separator = new DecimalFormatSymbols().getDecimalSeparator(); final char usedSeparator = separator == '.' ? ',' : '.'; value = value.replace(usedSeparator, separator); try {/*from w w w. ja va 2s . c o m*/ Double.parseDouble(value); } catch (final Exception e) { value = value.replace(separator, usedSeparator); } return value; } }