ROUND
Description
The ROUND function rounds a numeric value to the closest number.
It can be applied to FLOAT columns or INT columns. The result is a column of type FLOAT if precision
is specified. INT otherwise.
Floats exactly in the middle between two values are rounded to the next absolute bigger value (see example).
Syntax
ROUND ( column [, precision ] )
column: The input column where values should be rounded. Supported input type: FLOAT
precision: The number of decimal places to round input values to (can be negative)
NULL handling
If the input value is NULL, the result is NULL as well.
Example
[1] ROUND of positive FLOATs, negative FLOAT and a NULL value: | ||||||||||||||||
| ||||||||||||||||
|
[2] Round with | ||||||||||||||
| ||||||||||||||
|
[3] Ties are rounded away from zero: | ||||||||||
| ||||||||||
|
[4] ROUND has no effect on an INT column: | ||||||||||||||||
| ||||||||||||||||
|
[5] Ties are rounded away from zero: | ||||||||||
| ||||||||||
|
[6] Negative | ||||||||||||||||||
| ||||||||||||||||||
|