TRUNC
Truncates a number to an integer or to a specified number of decimal places by removing the fractional part.
| Category | Math |
| Syntax | TRUNC(number, [num_digits]) |
Parameters
| Parameter | Required | Description |
|---|---|---|
number | Required | The number you want to truncate. |
num_digits | Optional | The number of decimal places to keep. Defaults to 0. |
Example
TRUNC(3.7) // → 3
TRUNC(-2.1) // → -2
Auto-generated from the EngCanvas function registry.