Skip to main content

TRUNC

Truncates a number to an integer or to a specified number of decimal places by removing the fractional part.

CategoryMath
SyntaxTRUNC(number, [num_digits])

Parameters

ParameterRequiredDescription
numberRequiredThe number you want to truncate.
num_digitsOptionalThe 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.