User Tools

Site Tools


syntax:functions:truncate

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

syntax/functions/truncate.txt · Last modified: 2021/08/11 15:37 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki