Numeric Functions
ROUND
Overview
The ROUND()
function rounds numbers using round half to even method (bankers rounding).
Syntax
The following illustrates the syntax of the ROUND()
function:
Where:
number
: The number to round, it can be positive, negative, or zero, and it can be an Integer or a Double Precision.
Examples
Let’s explore some examples to see how the ROUND()
function works.
Case #1: Basic Usage
In this example, we round decimal numbers to integers:
The query will return the nearest integer for all provided values.
Case #2: Using ROUND
with Table
Suppose you have a table named Product that stores product prices with multiple decimal places. You want to round the prices.
We use the ROUND()
function to round the Price column when retrieving the data.
The result will display the product names along with their prices rounded.