Java Double Convert to convertDouble(String str, double defaults)

Here you can find the source of convertDouble(String str, double defaults)

Description

convert Double

License

Apache License

Declaration

public static double convertDouble(String str, double defaults) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static double convertDouble(String str, double defaults) {
        if (str == null) {
            return defaults;
        }/*from   w ww  .j  a  v a 2  s  . c  om*/
        try {
            return Double.parseDouble(str);
        } catch (Exception e) {
            return defaults;
        }
    }
}

Related

  1. convertDouble(Object param)
  2. convertDouble(String str)
  3. convertDouble2double(final Double[] pArray)
  4. convertDoubleArrayToString(double[] value, String separator)
  5. convertDoubleConsonant(byte[] b)
  6. convertDoubleFromBytes(final byte[] bytes)