Availability
This routine is available starting with katl-commons 2.5.
Syntax
trunc(number, digits)
Description
Truncates a number to a specified precision.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
number | Number | Yes | the number to truncate |
digits | Number | Yes | the precision |
Return type
number
Example
number a = trunc(1.1578212823495777, 3); print("a= " + a);
Prints: a= 1.157;
See also