Here you can find the source of convertStringToDouble(String number)
Return the Double value of the input string.
Parameter | Description |
---|---|
number | the number in String type |
public static Double convertStringToDouble(String number)
//package com.java2s; public class Main { /**/*from ww w.ja v a 2 s . c o m*/ * <p> * Return the Double value of the input string. * </p> * * @param number * the number in String type * @return * the number in Double type, return null * if the number can not be converted to Double * type. */ public static Double convertStringToDouble(String number) { if (number == null) { return null; } try { return Double.parseDouble(number); } catch (NumberFormatException e) { return null; } } }