List of utility methods to do String to Double Convert
double | transformToDigit(String numString) transform To Digit return Double.valueOf(numString).doubleValue();
|
double | getDouble(String str, double defaultValue) get Double if (str == null) return defaultValue; try { return Double.parseDouble(str); } catch (Exception e) { return defaultValue; |
Double | getDoubleFromStr(String str) get Double From Str Double i = 0.0; try { i = Double.valueOf(str); } catch (Exception e) { return i; |
Double | getDoubleValue(String value) Get Double value if (isBlank(value)) { throw new NumberFormatException(); return Double.parseDouble(value.replaceAll(",", ".")); |
String | parseDistance(double distance) parse Distance DecimalFormat df = new DecimalFormat("#.##"); return df.format(distance) + " km"; |
double | parseDouble(String string, double defValue) Parse string to boule try { return Double.parseDouble(string); } catch (NumberFormatException nfe) { return defValue; |
double | toDouble(String s) to Double double i = 0; try { i = Double.parseDouble(s); } catch (Exception e) { i = -1; return i; |