IMath.MRound

Fore Syntax

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

Fore.NET 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.

Fore 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.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.MathFin;

Public Shared Sub Main(Params: StartParams);
Var
    r: double;
    Math: MathClass = New MathClass();
Begin
    r := Math.MRound(103);
    System.Diagnostics.Debug.WriteLine(r);
End Sub;

See also:

IMath