trunc()

Truncates the given numeric value by removing its fractional part.

Syntax

trunc(value)

Parameters

Parameter Type Description
value Number Numeric value to truncate.

Return Value

Examples

trunc(3.9);  // returns 3
trunc(-2.7); // returns -2
trunc(5.0);  // returns 5

See also

round
roundup
floor
ceil
trunc
center
centerex