Well...
If cell with scientific notation holds only
1.00004E+11
, then you've got a problem. Why? Because
1.00004E+11
means
100004000000
.
If this cell holds
100004438998
value, but uses scientific notation, you're able to save its original value to csv file.
You haven't show us the code which is responsible for conversion. I guess that you are treating all as a text (for example by using
cell.Value.ToString()
). That's why you're getting wrong values!
In case, you still want to convert values stored in csv file, take a look at example and its output:
string line = @"1.00004E+11;100004438998;";
System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.GetCultureInfo("en-US");
long[] values = line.Split(new string[]{";"}, StringSplitOptions.RemoveEmptyEntries)
.Select(x=> long.Parse(x, System.Globalization.NumberStyles.AllowExponent | System.Globalization.NumberStyles.AllowDecimalPoint , ci))
.ToArray();
Result:
100004000000
100004438998
Conclusion: save original values (rather then text) to csv file and you'll get proper values!