IMath.MRound

Syntax

MRound(Value: Double; Precision: Double): Double;

Parameters

Value. Rounded value.

Precision. Rounding precision.

Description

The MRound method returns a number rounded with the specified precision.

Comments

Rounding up is done if the remainder from dividing the number by precision is greater or equal to a half of precision.

The Divisor parameter value cannot be equal to 0.

Example

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

Sub UserProc;
Var
    r: Double;
Begin
    r := Math.MRound(103);
    Debug.WriteLine(r);
End Sub UserProc;

After executing the example the console window displays the rounding result equal to 9.

See also:

IMath