Rounding to selected precision

Syntax

TRUNCATE(…num-expr…, …num-expr…)

TRUNCATE …num-expr…

Typing

num1, num2 -> largest(num1, num2)

Description

Truncate the first operand to the nearest (from below) multiple of the second, or to the nearest integer if no second operand is provided (it is then equivalent to floor .

Examples

expression evaluates to
TRUNCATE(153.6, 10) 150
TRUNCATE 5.8 5
TRUNCATE(-2.3) -3

See Also

Ceiling function Floor function Rounding