Here you can find the source of parseDouble(Object input)
Parameter | Description |
---|---|
input | the object that was parsed. |
public static Double parseDouble(Object input)
//package com.java2s; // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt import java.text.DecimalFormat; import java.text.ParseException; import java.util.Locale; public class Main { /**//from w ww . ja va 2s .c o m * DOC Zqin Comment method "parseDouble". * * @param input the object that was parsed. * @return the Double object represents this input */ public static Double parseDouble(Object input) { if (input != null) { // MOD yyi 2010-04-09 12483 Locale.getDefault() to Locale.US DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance(Locale.US); try { Number number = format.parse(input.toString()); return number.doubleValue(); } catch (ParseException e) { return Double.NaN; } } return null; } }