code: public static double toDouble(final String str, final double defaultValue) {
        if (str == null) {
            return defaultValue;
        }
        try {
            return Double.parseDouble(str);
        } catch (final NumberFormatException nfe) {
            return defaultValue;
        }
      }
docs: <p>Convert a <code>String</code> to a <code>double</code>, returning a
  default value if the conversion fails.</p>
  
  <p>If the string <code>str</code> is <code>null</code>, the default
  value is returned.</p>
  
  <pre>
  NumberUtils.toDouble(null, 1.1d)   = 1.1d
  NumberUtils.toDouble("", 1.1d)     = 1.1d
  NumberUtils.toDouble("1.5", 0.0d)  = 1.5d
  </pre>
  
  @param str the string to convert, may be <code>null</code>
  @param defaultValue the default value
  @return the double represented by the string, or defaultValue
  if conversion fails
  @since 2.1