List of utility methods to do Float Number Create
float[] | toFloat(double[] in) to Float float[] out = new float[in.length]; for (int i = 0; i < in.length; i++) { out[i] = (float) in[i]; return out; |
float[] | toFloat(double[] v) to Float final float[] ans = new float[v.length]; for (int k = 0; k < v.length; k++) ans[k] = (float) v[k]; return (ans); |
float | toFloat(final byte[] ba) Converts a byte[4] array to a float by placing the bytes after each other and interpreting is according to the IEEE 754 floating-point "single precision" bit layout (the one used by java and several other programming languages). return Float.intBitsToFloat(toInt(ba));
|
float | toFloat(final byte[] inputBytes, final int offset) to Float return Float.intBitsToFloat(toInt(inputBytes, offset));
|
Float | toFloat(final Integer value) to Float Float converted = null; if (null != value) { converted = value.floatValue(); return converted; |
Float | toFloat(final Object o, final String pattern) to Float if (o == null) { return null; } else if (o instanceof Float) { return (Float) o; } else if (o instanceof Number) { return new Float(((Number) o).floatValue()); } else if (o instanceof String) { return toFloat((String) o); ... |
Float | toFloat(final Object obj) to Float Float f = null; if (obj != null) { if (obj instanceof Double) { f = ((Double) obj).floatValue(); } else if (obj instanceof Float) { f = (Float) obj; return f; |
Float | toFloat(final Object valueRep) to Float return Float.parseFloat(String.valueOf(valueRep));
|
Float | toFloat(final String value) Converts a String to a float plus if the String is NULL, the returned value will be NULL. if (value == null) { return null; return Float.valueOf(value); |
float | toFloat(final String value) To float. if (value == null) { return 0.0F; String szTemp = ""; for (int i = 0; i < value.length(); i++) if (value.charAt(i) != ',') { szTemp = szTemp + value.charAt(i); try { final float f = Float.parseFloat(szTemp); return f; } catch (final NumberFormatException e) { final float f1 = 0.0F; return f1; |