Here you can find the source of toParse(double d)
public static double toParse(double d)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.Locale; public class Main { public static double toParse(double d) { double resultado; Locale locale = new Locale("en", "UK"); String pattern = "###.##"; DecimalFormat decimalFormat = (DecimalFormat) NumberFormat.getNumberInstance(locale); decimalFormat.applyPattern(pattern); String format = decimalFormat.format(d); resultado = Double.parseDouble(format); return resultado; }// w w w . j a va 2 s. c o m }