Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static double doDouble(Object obj) { return obj != null ? Double.parseDouble(obj.toString()) : 0; } public static double doDouble(Object obj, double defValue) { return obj != null ? Double.parseDouble(obj.toString()) : defValue; } }