This function rounds number n to integer digits behind the decimal point (round to nearest, in case of a tie away of the zero).
- If the second argument is not specified or NULL, rounding is conducted to an integer.
- If the second argument is negative, rounding is conducted to integer digits in front of the decimal point.
- If the second argument is a positive integer s, then the scale of the resulting data type will be s.
- If the data type of n is DOUBLE, then the result data type is also DOUBLE. Due to the problem of representation for DOUBLE values, the result could contain numbers with more digits after the decimal point than you would expect because of the rounding. Therefore we recommend that you always cast the result to an appropriate DECIMAL data type.
- For more information on the CEIL() and FLOOR() functions, see CEIL[ING] and FLOOR.