ROUND()

Scalar. Returns a given value rounded to a specified number of decimal places.

Syntax

ROUND( value, precision )
Parameters

value

The value to round.

precision

The number of places to the right or, if negative, the left of the decimal.

Data Types

Return

value

precision

Float

Float

Integer

Examples

The following example returns the value of the velocity column rounded to the nearest thousandth:

INSERT INTO OutStream
SELECT ROUND(Devices.velocity, 3)
FROM Devices;

The following example returns the value rounded to the nearest hundred, which in this case would be 800.0 (note the negative value for the precision):

INSERT INTO OutStream
SELECT ROUND(799.9, -2)
FROM Devices;