Round towards zero | MATH_TRUNCATE

Syntax

MATH_TRUNCATE( [value] )

Parameters

value
A number. If the value is not a NUMBER, the FLOAT operation will be used to convert it.

Return Value

Returns a number.

Description

Round a number towards 0. For a negative value, this operation works the same as the MATH_CEILING operation. For a positive value, this operation works the same as the MATH_FLOOR operation.

Examples

MATH_TRUNCATE(-16.7) # returns -16
MATH_FLOOR(16.7) # returns 16
MATH_TRUNCATE(null) # returns 0
MATH_TRUNCATE("-21.7") # returns -21