IMath.FloorD

Syntax

FloorD(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 FloorD method returns the result of rounding down to the nearest high-precision number that is the 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 the number and precision are positive, the value is rounded down, if the number and precision are negative, the value is rounded up. If a number is negative and precision is positive, the value is rounded down.

Example

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

Sub UserProc;
Var r1,r2,r3:Decimal;
Begin
    r1:= math.FloorD(3.726541233655125542365854m,2m);
    Debug.WriteLine(r1);
    r2:= math.FloorD(-2.5m,-2.365481235841654m);
    Debug.WriteLine(r2);
    r3:= math.FloorD(-2.55634576215697545m,2.54m);
    Debug.WriteLine(r3);
End Sub UserProc;

After executing the example the console window displays rounding results:

See also:

IMath