RoundTo

From Soldat Community Wiki
Jump to: navigation, search

From the Scripting Manual

function RoundTo(Number: extended; Decimals: integer): extended;

Parameter Info:
 Number (Extendedl): Numeric value to round up/down. Usually a float value
 Decimals (Integer): Amount of decimal places to return.

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

Examples

var
MyDub: double;
begin
    MyDub := 553.5484842;
    WriteLn(floattostr(RoundTo(MyDub,2))); //553.55 
end;


See also