Chinaunix首页 | 论坛 | 博客
  • 博客访问: 174771
  • 博文数量: 46
  • 博客积分: 1445
  • 博客等级: 上尉
  • 技术积分: 448
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-27 22:20
文章分类

全部博文(46)

文章存档

2013年(4)

2012年(12)

2011年(3)

2010年(5)

2009年(16)

2008年(6)

我的朋友

分类: Java

2012-07-24 08:54:08

NumberUtils
toDoublepublic static double toDouble(java.lang.String str, double defaultValue)

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
阅读(558) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~