IMath.CeilingD

Syntax

CeilingD(Value: Decimal; Precision: Decimal): Decimal;

Parameters

Value. Rounded decimal high-precision number.

Precision. A high-precision multiple, to which it is required to round.

Description

The CeilingD method rounds up the number to the nearest high-precision number, which is a multiple of precision.

Comments

To define numbers of the Decimal type in the array, it is necessary to write the "m" character after the value of each number. For example: 0.001m.

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.

Example

To execute the example, add a link to the MathFin system assembly.

Sub UserProc;
Var
    r1,r2,r3: Decimal;
Begin
    r1 := Math.CeilingD(1.554951234587512484m,0.1m);
    Debug.WriteLine(r1);
    r2 := Math.CeilingD(-2.5m,-2.365481235841654m);
    Debug.WriteLine(r2);
    r3 := Math.CeilingD(-2.55634576215697545m,2.54m);
    Debug.WriteLine(r3);
End Sub UserProc;

After executing the example the console window displays rounding results:

See also:

IMath