code: public static double parseNumber(String number, Locale locale) throws ParseException {
      if ("".equals(number)) {
        return Double.NaN;
      }
      return NumberFormat.getNumberInstance(locale).parse(number).doubleValue();
    }
docs: Parses a string with a locale and returns the corresponding number
  
  @throws ParseException if number cannot be parsed