Skip to main content

ROUND

Rounds a numeric argument.

See also:
[SELECT]


Syntax

SELECT ROUND(numeric_expression [, precision]) FROM <multipartIdentifier>;

Arguments

numeric_expression
An expression of the exact numeric or approximate numeric data type category.

precision
The number of digits to the right of the decimal point to round the numeric_expression to.

If the precision argument is omitted, it is assumed to be 0.

Return Value(s)

Returns a numeric value.


Examples

Round a floating point number to two decimal places

SELECT name, timeCreated,
round(julianday('now')-julianday(timeCreated), 2) as days_since
FROM google.storage.buckets WHERE project = 'stackql';

For more information, see https://www.sqlite.org/lang_corefunc.html#round