BROUND
Description
The Round Half to Even function (BROUND) is used to round a numeric expression expr
to a specified number of decimal places d
and return the processed numeric result. This function follows the round half to even rule and is applicable to various numeric types, including float, double, decimal, smallint, tinyint, int, and bigint.
Parameter Description
expr
(required): The numeric expression that needs to be processed using the round half to even rule.d
(optional): The number of decimal places to retain, of int type, supports negative values, with a default value of 0.
Return Result
Returns the processed numeric result, with the same type as the input expr
.
Usage Example
- Retain one decimal place:
- 保留两位小数:
- Retain negative decimal places (thousands):
- Default number of decimal places retained (0 places):
- Handling decimal type:
- Handling Different Numeric Types:
Summary
The round half to even function (BROUND) is a practical numerical processing function that can perform round half to even calculations on various types of numbers. By specifying the number of decimal places to retain, users can flexibly handle various numerical scenarios.