Here you can find the source of asDouble(Object obj)
public static double asDouble(Object obj)
//package com.java2s; //License from project: Open Source License public class Main { public static double asDouble(Object obj, double defvalue) { if (obj instanceof Number) return ((Number) obj).doubleValue(); if (obj instanceof String) { try { return Double.parseDouble((String) obj); } catch (NumberFormatException ex) { // log? }/*from w ww.ja va 2 s .c o m*/ } return defvalue; } public static double asDouble(Object obj) { return asDouble(obj, 0); } }