Here you can find the source of toDoubleByObject(Object obj)
public static Double toDoubleByObject(Object obj)
//package com.java2s; //License from project: Apache License public class Main { public static Double toDoubleByObject(Object obj) { try {//from ww w.j a va 2s . c om return Double.valueOf(toStringByObject(obj, true)); } catch (Exception e) { return 0.0d; } } public static String toStringByObject(Object obj) { return toStringByObject(obj, false); } public static String toStringByObject(Object obj, boolean isqdkg) { if (obj == null) { return ""; } else { if (isqdkg) { return obj.toString().trim(); } else { return obj.toString(); } } } }