I am having an issue in C# trying to convert a decimal using Decimal.Parse
with a decimal precision of 4 or more. It is throwing the error:
Input string was not in a correct format" when it tries to execute the function with the value 0.00006 or greater precision.
I have tried using InvariantCulture
and ruled that out as the issue, as that is what I saw being recommended for others getting this error.
I have also tried using decimal.Parse
to no avail.
The line of code being executed is:
Decimal decVal = Decimal.Parse(Value.ToString())
where value is the string "0.00006".
Has anyone else seen this problem before? Is this a problem inherent with the Decimal.Parse
function, or is it something that I am doing?