分类: Java
2012-07-24 08:54:08
Convert a String to a double, returning a default value if the conversion fails.
If the string str is null, the default value is returned.
NumberUtils.toDouble(null, 1.1d) = 1.1d NumberUtils.toDouble("", 1.1d) = 1.1d NumberUtils.toDouble("1.5", 0.0d) = 1.5d Parameters:str - the string to convert, may be nulldefaultValue - the default value