Table of Contents

Truncate(number)

Category: Number function


Description

This function returns the integer part of a number.


Arguments

ArgumentTypeDescription
numberNumberThe value, usually fractional, to be truncated.


Return value type: Number (Integer)


Remarks

This function does not perform any rounding process, it simply drops any decimal portion present in number.

Truncating a whole number (integer) simply returns that integer value.


Examples

truncate(-10.99) //Returns -10
truncate( 10.99) //Returns 10
truncate(100.1) //Returns 100
truncate(-54.78294) //Returns -54


See also