List of utility methods to do Object to Double
Double | asDouble(final Object o) as Double if (o instanceof Number) { return ((Number) o).doubleValue(); return null; |
Double | asDouble(final Object object) return Object value as Double if (object instanceof String) { return Double.parseDouble((String) object); } else if (object instanceof Number) { return ((Number) object).doubleValue(); return Double.NaN; |
Double | asDouble(Object o) Converts the given object to a Double
if (o instanceof Number) { return ((Number) o).doubleValue(); return null; |
double | asDouble(Object obj) as Double return asDouble(obj, 0);
|
Double | asDouble(Object val, Double def) as Double Double ret = null; try { ret = Double.valueOf(val.toString()); } catch (Exception e) { ret = def; return ret; |
double | asDouble(Object value) as Double if (value instanceof Double) { return ((Double) value).doubleValue(); throw new IllegalArgumentException("not a number"); |
double | asDouble(Object value) as Double if (value == null) { return -1; } else { return Double.parseDouble(value.toString()); |
double | asDouble(Object value) as Double return Double.valueOf(value.toString());
|
double | castDouble(Object o) cast Double return Double.valueOf(o.toString());
|
float | castDoubleToFloat(final double v) Safely cast a double to a float. if (Math.abs(v) > Float.MAX_VALUE) { throw new ArithmeticException("casted value is out of the range of float"); return (float) v; |