Java Double Parse tryParseDouble(String value)

Here you can find the source of tryParseDouble(String value)

Description

Try to parse the string as double or return null if failed

License

Open Source License

Parameter

Parameter Description
value a parameter

Declaration

public static Double tryParseDouble(String value) 

Method Source Code

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

public class Main {
    /**//w  w  w.j  a  va  2s . c om
     * Try to parse the string as double or return null if failed
     * 
     * @param value
     * @return
     */
    public static Double tryParseDouble(String value) {
        try {
            return Double.parseDouble(value);
        } catch (NumberFormatException e) {
            return null;
        }
    }
}

Related

  1. tryParseDouble(Object o)
  2. tryParseDouble(Object obj, Double defaultVal)
  3. tryParseDouble(String doubleValue)
  4. tryParseDouble(String value)