Convert.ToDouble Method (String) converts the specified String representation of a number to an equivalent double-precision floating point number.
I have this line of code:
double d = Convert.ToDouble(“0.3”);
and it gives me 3.0 instead of 0.3. For numbers greater than 1 it works as expected.
Why?
Most likely a locale problem. There are cultures where
.is not the decimal separator.Try
double.Parse("0.3",CultureInfo.InvariantCulture)