Here you can find the source of toDouble(Object obj)
public static double toDouble(Object obj)
//package com.java2s; //License from project: Open Source License public class Main { public static double toDouble(Object obj) { String str = obj != null ? obj.toString().trim() : ""; return "".equals(str) ? 0.00 : Double.parseDouble(str); }/*from w ww . java 2 s . c om*/ public static double toDouble(Object obj, double doubleStr) { String str = obj != null ? obj.toString().trim() : ""; return "".equals(str) ? doubleStr : Double.parseDouble(str); } public static String toString(Object obj) { return obj != null ? obj.toString() : ""; } public static String toString(Object obj, String str) { return obj != null ? obj.toString() : str; } }