Here you can find the source of objectToDouble(Object o)
public static final double objectToDouble(Object o)
//package com.java2s; //License from project: Apache License public class Main { public static final double objectToDouble(Object o) { if (o instanceof Number) return ((Number) o).doubleValue(); try {/*from w w w .jav a 2s. c om*/ if (o == null) return -1D; else return Double.parseDouble(o.toString()); } catch (NumberFormatException e) { return -1D; } } }