Trunc(Value: Double; Precision: Integer): Double;
Value. Truncated number.
Precision. The number of decimal places that determines truncate precision.
The Trunc method truncates variable points to selected number of decimal places.
Values of input parameters cannot be empty.
When the value is positive, the fractional part is truncated; when the value is negative, integer part is truncated, when the value is "0", the number is truncated to an integer.
To execute the example, add a link to the MathFin system assembly.
Sub UserProc;
Var
r: Double;
Begin
r := Math.Trunc(8.5461263451,2);
Debug.WriteLine(r);
End Sub UserProc;
After executing the example the console window displays the truncate result equal to -8.54.
See also: