Hi,
I need to know how to round a float to 2 decimal places.
lets say this is my code:
Assuming EdtTotalBooks,EdtBookCost, and EdtTotal are edit boxes.
float Temp;
Temp = StrToFloat(EdtTotalBooks->Text);
Temp = Temp * StrToFloat(EdtBookCost->Text);
EdtTotal->Text = FloatToStr(Temp);
For some reason, I get some long float even for simple numbers. For example 6 * 10.1 gives me 60.6000022888184
Any ideas would be helpful,
Thanks
I need to know how to round a float to 2 decimal places.
lets say this is my code:
Assuming EdtTotalBooks,EdtBookCost, and EdtTotal are edit boxes.
float Temp;
Temp = StrToFloat(EdtTotalBooks->Text);
Temp = Temp * StrToFloat(EdtBookCost->Text);
EdtTotal->Text = FloatToStr(Temp);
For some reason, I get some long float even for simple numbers. For example 6 * 10.1 gives me 60.6000022888184
Any ideas would be helpful,
Thanks