我正在尝试将字符串转换为Integer/Float/Double但我得到了一个NumberFormatException.
我的字符串是37,78584,现在我将其转换为我得到的任何一个NumberFormatException.
我怎样才能将其转换string为其中任何一个.
请帮我解决这个问题.
Pet*_*rey 11
您必须使用适当的区域设置作为数字
String s = "37,78584";
Number number = NumberFormat.getNumberInstance(Locale.FRENCH).parse(s);
double d= number.doubleValue();
System.out.println(d);
Run Code Online (Sandbox Code Playgroud)
版画
37.78584
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6016 次 |
| 最近记录: |