Java Double Number Create toDouble(String doubleString, Double defaultValue)

Here you can find the source of toDouble(String doubleString, Double defaultValue)

Description

to Double

License

Open Source License

Declaration

protected static Double toDouble(String doubleString, Double defaultValue) throws NumberFormatException 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    protected static Double toDouble(String doubleString, Double defaultValue) throws NumberFormatException {

        try {/*from   w w w  . j  a v  a 2 s.  c  o  m*/
            double d = Double.parseDouble(doubleString);
            return d;
        } catch (NumberFormatException e) {
            return defaultValue;
        }
    }
}

Related

  1. toDouble(Object value, double nullValue)
  2. toDouble(Object x)
  3. toDouble(short[] arr)
  4. toDouble(short[] src)
  5. toDouble(String aString)
  6. toDouble(String input, double defaultValue)
  7. toDouble(String parameter)
  8. toDouble(String s)
  9. toDouble(String s)