Here you can find the source of objectToDouble(Object obj)
public static double objectToDouble(Object obj)
//package com.java2s; //License from project: Apache License public class Main { public static double objectToDouble(Object obj) { return objectToDouble(obj, 0f); }/*w w w . j ava2 s .com*/ public static double objectToDouble(Object obj, double added) { double result = 0; try { result = Double.parseDouble(obj.toString()); } catch (Exception e) { result = added; } return result; } }