Skip to main content

ROUND

Returns a numeric value, rounded to the specified length or precision.

Syntax​

ROUND ( numeric_expression, length )

Arguments​

numeric_expression
Is an expression of the exact numeric or approximate numeric data type category.

length
Is the precision to which numeric_expression is to be rounded. Length must be a whole integer.

Return Type​

Returns values of type FLOAT64.

Examples​

Examples in this section use the example blockchain.

This example shows the results of using the ROUND function. Each real value is rounded to the precision of its corresponding integer value.

SELECT ROUND(real, integer) FROM example;

Response:

ROUND(real, integer) [FLOAT64]
NULL
0
1
2