Here you can find the source of toDouble(String s)
Parameter | Description |
---|---|
s | is the string to parse as a Double |
public static Double toDouble(String s)
//package com.java2s; public class Main { /**/*from w ww.jav a 2 s.c o m*/ * Translate a string s to a Double. * * @param s is the string to parse as a Double * @return the double translation of string s, or return null if s is not a * double/integer. */ public static Double toDouble(String s) { Double i = null; try { i = Double.parseDouble(s); } catch (NumberFormatException e) { // leave i = null } return i; } }