RoundTo

From Soldat Community Wiki
Revision as of 10:36, 15 August 2012 by Freeman (talk | contribs) (Created page with "===From the Scripting Manual=== ''function RoundTo(Number: extended; Decimals: integer): extended;'' '''Parameter Info:''' Number (Extendedl): Numeric value to round up/...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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;


External Links