Java String to Double asDouble(String str)

Here you can find the source of asDouble(String str)

Description

as Double

License

LGPL

Declaration

private static double asDouble(String str) 

Method Source Code

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

public class Main {
    private static double asDouble(String str) {
        try {//from   w  w w.j  a  v a  2 s .  c  o m
            return Double.valueOf(str);
        } catch (NumberFormatException nfex) {
            return Double.NaN;
        }
    }
}

Related

  1. asDouble(final String str, final double def)
  2. asDouble(String string)
  3. asDouble(String value)
  4. atof(String pString_)
  5. atof(String s)