Appearance
Round2Up
Declaration
Function Round2Up( aValue : Extended; aDigit : integer) : Extended
Example
pascal
procedure OnMapEvent(var Value:Variant);
begin
Value := Round2Up(123.455,2) //result is 123.46
end;Description
Returns aValue rounded to the number of decimal places given by aDigit. This function performs unbiased rounding (traditional rounding). 1-4 is rounded down, 5-9 is rounded up.
Refer toRound2 for a function that rounds 5 down instead of up. Refer to Round2BR for a function that uses biased rounding (bankers rounding).
Examples of rounding ...
Round2Up(123.454,2) = 123.45
Round2Up(123.455,2) = 123.46
Round2Up(123.456,2) = 123.46
Round2Up(123.4545,3) = 123.455