List of utility methods to do Float to String
String | FloatToString(float value) Float To String Float f = new Float(value); NumberFormat fmt = NumberFormat.getNumberInstance(); String s = fmt.format(f.doubleValue()); return s; |
String | floatToString(float value) convert float to String with two fractional digits if (Float.isNaN(value)) { return " --- "; return String.format("%.2f", value); |
String | floatToString(float value, int precision) Converts a float to a string. String str = String.valueOf(value); int dot = str.indexOf('.'); if (precision > 0) { precision++; if (dot > 0 && str.length() > dot + precision) { str = str.substring(0, dot + precision); return str; |
String | floatToString(float value, String format) Converts a float to a string. return doubleToString(value, format);
|
String[] | floatToString(float[] values) float To String if (values == null) { return null; String[] results = new String[values.length]; for (int i = 0; i < values.length; i++) { results[i] = String.valueOf(values[i]); return results; ... |
String | floatToString0(float value) float To String if (Float.isNaN(value)) { value = 0f; return String.format("%.2f", value); |