[1.16.5] java.lang.NumberFormatException: For input string: ",00"
jmploc opened this issue ยท 5 comments
Crash Report:
crash-2022-05-11_16.17.48-server.txt
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.
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.
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
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.