List of utility methods to do Double Number Create
Double | toDouble(String val) to Double Double l = 0.0; boolean dig = false; long len = 10; long digs = 0; for (char c : val.toCharArray()) { if (Character.isDigit(c)) { if (dig) { digs = digs * 10 + c - 48; ... |
Double | toDouble(String value) to Double if (null == value) { return null; value = value.trim(); if ("null".equals(value)) { return null; return Double.parseDouble(value); ... |
double | toDouble(String value) Extends the Double#valueOf(String) method, in removing the leading and trailing whitespace. if (value == null) { return Double.NaN; value = value.trim(); return Double.parseDouble(value); |
double | toDouble(String value) Gets the double value of the input string value. try { value = value.replaceAll("[\\s+ \\$]", ""); if (value != null) { return Double.parseDouble(value); } catch (Exception ex) { return 0; ... |
Double | toDouble(String value) Converts the specified value string to the Double value. if (value == null || value.equals("")) { return null; try { return Double.parseDouble(value); } catch (NumberFormatException e) { throw new IllegalArgumentException("invalid boolean value : " + value); |
double | toDouble(String value, double defaultValue) Returns the given String parsed to a Double. try { return Double.parseDouble(value); } catch (NumberFormatException e) { return defaultValue; |
double | toDouble(String value, double defaultValue) convert the string to an double, and return the default value if the string is null or does not contain a valid int value if (value != null) { try { return Double.parseDouble(value); } catch (NumberFormatException n) { return defaultValue; |
double | toDouble(String value, double defaultValue) to Double if (isNullOrEmpty(value)) return defaultValue; try { return Double.parseDouble(value.trim()); } catch (NumberFormatException ex) { return defaultValue; |
Double | toDouble(String value, Double defaultValue) to Double if (isEmpty(value)) return defaultValue; try { return Double.parseDouble(value); } catch (Exception e) { return defaultValue; |
Double | toDouble(String value, Double fallback) to Double if (value == null || value.isEmpty()) { return fallback; try { return Double.valueOf(value); } catch (Exception e) { return fallback; |