Here you can find the source of toDouble(Locale locale, String value)
public static double toDouble(Locale locale, String value)
//package com.java2s; //License from project: Open Source License import java.text.NumberFormat; import java.text.ParsePosition; import java.util.Locale; public class Main { public static double toDouble(Locale locale, String value) { value = value.trim();//from ww w . j a v a 2s. c om ParsePosition pos = new ParsePosition(0); Number result = NumberFormat.getInstance(locale).parse(value, pos); if (pos.getIndex() != value.length()) throw new NumberFormatException("Could not parse: " + value); return result.doubleValue(); } }