List of utility methods to do String to Float
float | asFloat(final String str, final float def) Parse string to float, if string can't be parsed to float, then it will return given default value. try { return Float.parseFloat(str); } catch (final NumberFormatException e) { return def; |
Float | asFloat(String string) Converts string to float return (string == null) ? null : Float.valueOf(string);
|
Float | asFloat(String v) as Float try { return (v != null) ? Float.valueOf(v) : null; } catch (NumberFormatException ex) { return null; |
float | asFloat(String value) Converts a String value into a float .
return Float.parseFloat(value);
|
float | atof(final String str, final float def) atof try { return Float.parseFloat(str); } catch (final Exception ex) { ex.printStackTrace(); return def; |