IMath.Trunc

Syntax

Trunc(Value: Double; Precision: Integer): Double;

Parameters

Value. Truncated number.

Precision. The number of decimal places that determines truncate precision.

Description

The Trunc method truncates variable points to selected number of decimal places.

Comments

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.

Example

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:

IMath | IMath.Int