Discards every digit of to the right of the y'th digit of x. Y is an optional parameter, if it is not supplied, 0 is taken, that is: Truncate(x) is the same as Truncate(x,0).
Truncate( x ) Truncate( x, #places )
x | A (decimal) number |
---|---|
#places | Whole number of decimal places [OPTIONAL...default: 0]. |
Numeric value
truncate( 3.8 ) //3 truncate( 1.2 ) //1 truncate( 4.5 ) //4 truncate( 3.14, 1) // 3.1 truncate(23.112, -1) // 20.0