I have a raspberry pi with system language set to "de_DE.UTF-8" and mono version 3.28 installed. My programs need to convert Strings
into Doubles
, but I ran into a few problems:
Double.Parse("500", NumberStyles.Float, CultureInfo.InvariantCulture);
Works just fine.
Double.Parse("500.123", NumberStyles.Float, CultureInfo.InvariantCulture);
Throws FormatException
, what is weird.
Double.Parse("500,123", NumberStyles.Float, CultureInfo.GetCultureInfo("de-DE"));
Throws FormatException
too;
The funny thing is if I change my system language (sudo raspi-config) to "en-GB.UTF-8" all functions work as expected. Anyone knows how to solve this as a German user I would like to use German system settings.
The bug is fixed in mono 3.4 which is not yet uploaded in raspberry repo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With