-2
我:异常Java.lang.NumberFormatException
DecimalFormat mydf = new DecimalFormat("#,##0.00");
mydf.format(Double.parseDouble(item.getText(4)
.replaceAll(",", ""))
+ Double.parseDouble(item.getText(6)
.replaceAll(",", ""))
+ Double.parseDouble(item.getText(8)
.replaceAll(",", "")))
其中,项目”是一个表项,它返回字符串,我得到错误的时候,‘item.getText’对价'24,807,847.65' 。 我以为Double可以处理这个数字。
尝试使用DecimalFormat(“#,###。##”); –