I ran into a problem while converting a string to decimal. My C # code reads the following data from an exel file and throws me the following error
The input string was not in the correct format "-1.799999999999999999E-2".
I do not see this value in my excel value.
Data examples
-1.70152
9.335628333
-150.0145233
39.159625
C # code
TestModel.lat = Convert.ToDecimal(c.CellValue.Text);
Is my conversion correct. I lose any values ββduring the conversion. What is the best datataype to convert to inorder to keep the original value as it is?
source
share