CeilingI(Value: Integer; Precision: Integer): Integer;
Value. Rounded integer.
Precision. An integermultiple, to which it is required to round.
The CeilingI method rounds up the number to the nearest integer, which is a multiple of precision.
If a number and precision are positive, the value is rounded up.
If a number and precision are negative, the value is rounded up.
If a number is negative and precision is positive, the value is rounded up.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
r1,r2,r3: Integer;
Begin
r1 := Math.CeilingI(7,2);
Debug.WriteLine(r1);
r2 := Math.CeilingI(-8,-3);
Debug.WriteLine(r2);
r3 := Math.CeilingI(-11,6);
Debug.WriteLine(r3);
End Sub UserProc;
After executing the example the console window displays rounding results:
Number and precision are positive: 8.
Number and precision are negative: -9.
Number is negative and precision is positive: -6.
See also: