List of utility methods to do Float Number Create
float | toFloat(Object _inStrObj) to Float if (_inStrObj == null || _inStrObj.toString().trim().equals("")) { return 0; } else { return Float.valueOf(_inStrObj.toString()).floatValue(); |
Float | toFloat(Object anObj) Converts given value to Float. if (anObj == null) return null; Float tmpResult = null; if (anObj instanceof Float) { tmpResult = (Float) anObj; } else if (anObj instanceof Number) { tmpResult = new Float(((Number) anObj).floatValue()); } else { ... |
Float | toFloat(Object literal) to Float if (literal instanceof Number) { return ((Number) literal).floatValue(); if (literal instanceof String) { try { return Float.valueOf((String) literal); } catch (NumberFormatException e) { return null; |
Float | toFloat(Object o) to Float if (o == null) return null; if (o.getClass() == Float.class) return (Float) o; if (o.getClass() == Boolean.class) return booleanToFloat((Boolean) o); if (o.getClass() == Byte.class) return (float) ((Byte) o).byteValue(); ... |
Float | toFloat(Object o) to Float Float f; if (o instanceof Float) { f = (Float) o; } else { try { f = Float.valueOf(o.toString()); } catch (Exception e) { f = null; ... |
Float | toFloat(Object o) to Float if (o == null) { return null; return Float.valueOf(String.valueOf(o)); |
Float | toFloat(Object ob, Float defaultFloat) to Float if (ob == null) { return defaultFloat; if (ob instanceof Integer) { return ((Integer) ob).floatValue(); } else if (ob instanceof Float) { return ((Float) ob).floatValue(); } else if (ob instanceof Double) { ... |
Float | toFloat(Object obj) to Float if (obj instanceof String) return Float.valueOf((String) obj); if (obj instanceof Byte) { Byte b = (Byte) obj; return b.floatValue(); if (obj instanceof Short) { Short s = (Short) obj; ... |
float | toFloat(Object obj) to Float return toFloat(obj, 0);
|
float | toFloat(Object obj) Get the float value of this object, only if the object is an instance of Number return (obj instanceof Number) ? ((Number) obj).floatValue() : 0.0f; |