Tuesday, 20 August 2013

c# - Reading double from file , Precision issue

c# - Reading double from file , Precision issue

I have to read a tab-delimited file, where each row contains both strings
and doubles.
string line = reader.ReadLine();
string[] elements = line.Split('\t');
My problem is that all doubles read from the file are converted to a lower
precision. For example: 0.34704774 is stored as 0.35 in the string array
elements.
How can I read and store all the values as they are written in the file?

No comments:

Post a Comment