List of utility methods to do Double Number Create
Double | toDouble(Object o) to Double Double result = null; if (o instanceof Double) { result = (Double) o; } else if (o instanceof String) { result = Double.parseDouble((String) o); } else if (o instanceof Integer) { result = new Double((Integer) o); return result; |
Double | toDouble(Object o) to Double if (o == null) { return null; return Double.valueOf(String.valueOf(o)); |
double | toDouble(Object o) to Double if (o instanceof Integer) return new Double(((Integer) o).intValue()); if (o instanceof Double) return ((Double) o); if (o instanceof String) { try { return new Double(Double.parseDouble((String) o)); } catch (NumberFormatException ex) { ... |
Double | toDouble(Object o) Attempts to cast an arbitrary object to a Double. if (o instanceof Double) { return (Double) o; } else { return Double.valueOf(o.toString()); |
Double | toDouble(Object o) to Double if (o == null) return null; if (o.getClass() == Double.class) return (Double) o; if (o.getClass() == Boolean.class) return booleanToDouble((Boolean) o); if (o.getClass() == Byte.class) return (double) ((Byte) o).byteValue(); ... |
Double | toDouble(Object ob, Double defaultDouble) to Double if (ob == null) { return defaultDouble; if (ob instanceof Integer) { return ((Integer) ob).doubleValue(); } else if (ob instanceof Float) { return ((Float) ob).doubleValue(); } else if (ob instanceof Double) { ... |
double | toDouble(Object obj) Get the double value of this object, only if the object is an instance of Number return (obj instanceof Number) ? ((Number) obj).doubleValue() : 0.0d; |
double | toDouble(Object obj) This method convert object to Double. double value = 0; if (obj != null) { value = ((Double) obj).doubleValue(); return value; |
double | toDouble(Object obj) to Double if (obj instanceof Integer) { return ((Integer) obj).doubleValue(); if (obj instanceof Double) { return ((Double) obj).doubleValue(); if (obj instanceof Long) { return ((Long) obj).doubleValue(); ... |
double | toDouble(Object obj) to Double String str = obj != null ? obj.toString().trim() : ""; return "".equals(str) ? 0.00 : Double.parseDouble(str); |