SQLite ROUND() Function
Definition and Usage
The ROUND() function rounds a number to a given number of decimals.
A number that is exactly halfway is rounded away from zero, so 2.5 becomes 3.0, and -2.5 becomes -3.0.
Tip: Also look at CEIL(), FLOOR(), TRUNC().
Syntax
ROUND(number, decimals)
Parameter Values
| Parameter | Description |
|---|---|
| number | Required. The number to round |
| decimals | Optional. The number of decimals. Default is 0 |
Technical Details
| Return type: | Real |
|---|
More Examples
Example
Round the prices to whole numbers:
SELECT ProductName, Price, ROUND(Price)
FROM Products;
Try it Yourself »