Here you can find the source of toDouble(Object o)
public static double toDouble(Object o)
//package com.java2s; //License from project: Open Source License public class Main { public static double toDouble(Object o) { if (o instanceof Integer) return new Double(((Integer) o).intValue()); if (o instanceof Double) return ((Double) o); if (o instanceof String) { try { return new Double(Double.parseDouble((String) o)); } catch (NumberFormatException ex) { // eat it and drop thru to default return }/*w w w. j ava2 s. co m*/ } return 0.0; } }