This SQLite post explains how to use the SQLite round function with syntax and examples.
The SQLite round function returns a number rounded to a certain number of decimal places.
The syntax for the round function in SQLite is:
round( number, [ decimal_places ] )
The number to round.
The number of decimal places rounded to. If this parameter is omitted, the round function will round the number to 0 decimal places.
The round function can be used in the following versions of SQLite:
Let's look at some SQLite round function examples and explore how to use the round function in SQLite.
For example:
sqlite> SELECT round(835.526);
Output: 836.0
sqlite> SELECT round(835.526, 0);
Output: 836.0
sqlite> SELECT round(835.526, 1);
Output: 835.5
sqlite> SELECT round(835.526, 2);
Output: 835.53
sqlite> SELECT round(835.5269, 3);
Output: 835.527