MRound(Value: Double; Precision: Double): Double;
MRound(Value: double; Precision: double): double;
Value. Rounded value.
Precision. Rounding precision.
The MRound method returns a number rounded with the specified precision.
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.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
r: Double;
Begin
r := Math.MRound(10, 3);
Debug.WriteLine(r);
End Sub UserProc;
After executing the example the console window displays the rounding result equal to 9.
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(10, 3);
System.Diagnostics.Debug.WriteLine(r);
End Sub;
See also: