Skip to main content

Categories: Math

BROUND

Returns the rounded value using banker's rounding (HALF_EVEN). When the input is exactly halfway between two integers, rounds to the nearest even number. Returns NULL if the input is NULL.

Syntax​

BROUND(numeric_expression double) → double​

  • numeric_expression: The DOUBLE value to round using banker's rounding.

Examples

BROUND example
SELECT BROUND(50.2), BROUND(50.5), BROUND(50.55), BROUND(-50)
-- 50.0, 50.0, 51.0, -50.0
Round a value halfway between two integers down to the even number
SELECT BROUND(2.5)
-- 2.0
Round a value halfway between two integers up to the even number
SELECT BROUND(3.5)
-- 4.0
Round a value below the halfway point
SELECT BROUND(2.4)
-- 2.0
Round a negative value halfway between two integers
SELECT BROUND(-2.5)
-- -2.0