code: public static double toDouble(Object value, double defaultValue) {
  		if (value == null || value.toString().trim().equals("")) {
  			return defaultValue;
  		}
  		if (value instanceof Double) {
  			return (double) value;
  		}
  		if (value instanceof Date) {
  			final Date date = (Date) value;
  			return date.getTime();
  		}
  		return Double.parseDouble(value.toString());
  	}
docs: To double.
  
  @param value the value
  @param defaultValue the default value
  @return the double