Here you can find the source of toDouble(String string)
Parameter | Description |
---|---|
string | a parameter |
public static double toDouble(String string)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w. j ava 2s . c o m * string2Double * * @param string * @return double */ public static double toDouble(String string) { String str = trim(string); if ("".equals(str)) str = "0.0"; return Double.parseDouble(str); } /** * trim * * @param string * @return */ public static String trim(String string) { if (string == null) return ""; else return string.trim(); } }