Convert.ToDecimal
doesn't support the scientific notation.
It is documented that Convert.ToDecimal
internally uses Decimal.Parse
and the documentation for Decimal.Parse
states that this uses NumberStyles.Number
and thus only the following is a valid input:
[ws][sign][digits,]digits[.fractional-digits][ws]
To support scientific notation you will have to use another overload of Decimal.Parse
that allows you to specify the NumberStyles
to be used:
var result = decimal.Parse("3.14521963414679E-08",
NumberStyles.Number | NumberStyles.AllowExponent);