The problem is the culture being used to do the conversion. Your operating system is probably configured for a culture that does not consider the dot (i.e. .
) as the decimal separator.
In order to do the conversion, you will not be able to let the Convert.ToDouble
method use the default culture of the operating system.
For this it is possible to pass a parameter to the Convert.ToDouble
method indicating the culture:
Convert.ToDouble(ValueString, CultureInfo.InvariantCulture);
-
CultureInfo.InvariantCulture
: is a culture that does not change over time. The decimal point is always .
.