The ROUND function in Oracle can round numbers to a specified precision. The syntax is: ROUND(number, decimals). Among them, number is the number to be rounded, and decimals is the rounding precision. Example: Round 123.456 to one decimal place: ROUND(123.456, 1); Round to two decimal places: ROUND(123.456, 2); Round to an integer: ROUND(123.456, 0).
ROUND Function in Oracle
The ROUND function is used to round a number to a specified precision. It has the following syntax:
<code>ROUND(number, decimals)</code>
where:
Usage Examples
The following are some usage examples of the ROUND function:
<code>SELECT ROUND(123.456, 1) FROM dual;</code>
Output:
<code>123.5</code>
<code>SELECT ROUND(123.456, 2) FROM dual;</code>
Output:
<code>123.46</code>
<code>SELECT ROUND(123.456, 0) FROM dual;</code>
Output:
<code>123</code>
Notes
The above is the detailed content of How to use round function in oracle. For more information, please follow other related articles on the PHP Chinese website!