Round

From Soldat Community Wiki
Jump to: navigation, search

From the Scripting Manual

function round(Number: real): integer;

Parameter Info:
 Number (Real): Numeric value to round up/down.

Description:
 This function will return the rounded up/down value of parameter 'Number'

Examples

var
MyDub: double;
MyInt: integer;
begin
    MyDub := 553.55;
    MyInt := 42;
    WriteLn(inttostr(round(MyInt))); //42
    WriteLn(inttostr(round(MyDub))); //554
end;


See also