Here you can find the source of asDouble(Object val, Double def)
public static Double asDouble(Object val, Double def)
//package com.java2s; public class Main { public static Double asDouble(Object val) { return asDouble(val, null); }/*from www .j av a 2 s. c om*/ public static Double asDouble(Object val, Double def) { Double ret = null; try { ret = Double.valueOf(val.toString()); } catch (Exception e) { ret = def; } return ret; } }