Doubles, commas and dots

后端 未结 7 1184
深忆病人
深忆病人 2020-12-14 09:03

I\'m making an Android Java program which is taking double values from the user. If I run the program on the computer, it works great because of the locale of my computer, E

7条回答
  •  眼角桃花
    2020-12-14 09:25

    Me Error:

    java.lang.NumberFormatException: Invalid float: "1,683.88"
    

    ... and this work for me

    replace(",", "")
    

提交回复
热议问题