Reducing decimal places in Delphi
- by Hendriksen123
I am storing a list of numbers (as Double) in a text file, then reading them out again.
When I read them out of the text file however, the numbers are placed into the text box as 1.59993499 for example, instead of 1.6.
AssignFile(Pipe, 'EconomicData.data');
Reset(Pipe);
For i := 1 to 15
Do ReadLn(Pipe, SavedValue[i]);
CloseFile(Pipe);
Edit1.Text := FloatToStr(SavedValue[1]);
The text in Edit1.text, from the code above, would be 1.59999... instead of the 1.6 in the text file. How can i make it so the text box displays the original value (1.6)?