Cold Sweat

Cold Sweat

3M Downloads

[1.16.5] java.lang.NumberFormatException: For input string: ",00"

jmploc opened this issue ยท 5 comments

commented

I honestly have no idea what could have triggered this crash. Numbers don't even have commas, so why would it do that? Very odd.

commented

if you do toString on a floating point number without passing Locale.ROOT you get a decimal seperator based on the user's system locale, german and russian both use commas as the seperator, when you then try to parse it again it will use Locale.ROOT, thereby causing this problem.

commented

Also if you're trying to numerically crop a double please do something like

return (int)(x * Math.pow(10.0, sigplaces)) / Math.pow(10.0, sigplaces);

Just beware that no such number may actually exist and you'll just get the closest number

commented

Yes, I use russian locale

commented

Thank you for bringing some light to this issue, @DaedalusGame. I guess I still have a while to go before I'm perfect at Java.
I'll implement this in the next release.