Math.trunc

Returns the integer part of the a number removing any fractional digits.

Syntax

trunc(value)

Parameters

Return value

An integer number.

Examples

Math.trunc(1.23)
1
Math.trunc(42)
42