The ROUND numeric function rounds a supplied value to a given number of places.
If precision is a positive number, source_number is rounded to precision places right of the decimal point. If precision is negative, the result is source_number rounded to the absolute value of precision places to the left of the decimal point.
source_number can be any built-in numeric data type. precision must be an integer. The result of the function is INTEGER if the first parameter is INTEGER, FLOAT if the first parameter is FLOAT, and DECIMAL if the first parameter is DECIMAL. The result is of the same type as the source_number parameter unless it is NULL, in which case the result is NULL. When rounding a DECIMAL, the banker's or half even symmetric rounding rules are used. Details of these can be found in ESQL DECIMAL data type.
ROUND(27.75, 2)returns 27.75
ROUND(27.75, 1)returns 27.8
ROUND(27.75, 0)returns 28.0
ROUND(27.75, -1)returns 30.0
If possible, the scale is changed to the given value. If the result cannot be represented within the given scale, it is INF.
Notices |
Trademarks |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
ak05380_ |