ROUND
Description
The ROUND function is used to round numerical expressions to a specified number of decimal places. This function supports various input data types, including float, double, decimal, smallint, tinyint, int, and bigint.
Syntax Format
Parameter Description
expr
: The numeric type expression that needs to be rounded.d
: An integer used to specify the number of decimal places to retain, supports negative values. The default value is 0.
Return Result
Returns the rounded numeric result, with the same type as the input expr
.
Usage Example
- Retain one decimal place:
- Retain two decimal places:
- Retain the Integer Part:
- Omit the decimal part:
- Rounding negative numbers:
- Round the decimal type: