I am trying to convert a string to a double value, but that does not return to me what I expect ...
double dbl; Double.TryParse("20.0", out dbl);
This piece of code returns 200.0 (instead of 20.0) as a double value. Any idea why?
You must pass to the InvariantCulturemethod.
InvariantCulture
The reason for this is because your regional settings are probably set .as a delimiter, not a decimal point.
.
double.TryParse("20.0", NumberStyles.Any, CultureInfo.InvariantCulture, out x);