SPECIAL OFFER        Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming!

⤷ Different ways to round number

Use Trunc function for getting integer value of number.
Use Round function for getting nearest whole number.
And Str procedure converts number to a string with specific representation.

procedure TForm1.Button1Click(Sender: TObject);
var
   St: string;
   Number: Real;
begin
   Number:=StrToFloat(Edit1.Text);
   Label2.Caption:='Trunc - '+FloatToStr(Trunc(Number));
   Label3.Caption:='Round - '+FloatToStr(Round(Number));
   Str(Number:4:2, St);
   Label4.Caption:=St;
end;
More for developers
Databases for Amazon Associates
Amazon Categories
Amazon Nodes