AbsD(Value: Decimal): Decimal;
AbsD(Value: decimal): decimal;
Value. High-precision decimal number, which absolute value must be found.
The AbsD method returns the absolute value (module) of a high-precision decimal number.
To define numbers of the Decimal type in the array, add the m character after each number. For example: 0.001m.
To get absolute value of integer number, use the IMath.AbsI method.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
r: Decimal;
Begin
r := Math.AbsD(-4.645m);
Debug.WriteLine(r);
End Sub UserProc;
After executing the example the console window displays the absolute value of the set value 4.645.
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: decimal;
Math: MathClass = New MathClass();
Begin
r := Math.AbsD(-4.645m);
System.Diagnostics.Debug.WriteLine(r);
End Sub;
See also: