[SOLVED] Parsing a double

Hi, I’m running into a weird problem.

I wish to parse a double from a string (e.g. “-1.1”), but the double.Parse method makes the comma vanish, so I get -11 instead of -1.1. And more surprisingly, this issue doesn’t appear in Visual Studio. Am I missing something?

Any help appreciated

Check regional settings. In some countries the dot means thousands separator, and a comma is the decimal separator.
I’ve been there in some many languages…

1 Like

Thx so much. All I needed to do was replacing the commas w/ points

Hello,
This can do the job, so long you remain on the same culture.
To write a more flexible application, that is able to adapt to different cultures, have a look there :
https://docs.microsoft.com/en-us/dotnet/standard/base-types/parsing-numeric