Java Double Parse tryParseDouble(String value)

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

Description

try Parse Double

License

LGPL

Declaration

protected static double tryParseDouble(String value) 

Method Source Code

//package com.java2s;
/*/*from w  w  w.  ja  v  a2s .c o m*/
 * @author     ucchy
 * @license    LGPLv3
 * @copyright  Copyright ucchy 2015
 */

public class Main {

    protected static double tryParseDouble(String value) {
        try {
            return Double.parseDouble(value);
        } catch (NumberFormatException e) {
            return -1;
        }
    }
}

Related

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