Round
round
The round function rounds a numeric value to the nearest integer or specified number of decimal places.
Spec
round(arg0, [decimals]) Parameters
arg0 - The numeric value to round.
decimals (optional) - The number of decimal places to round to. Defaults to 0. Return Value
The rounded value. Example
Round to nearest integer:
datatable(val:real)[1.7, 2.3, -1.8]
| extend rounded = round(val) | val | rounded |
|---|---|
| 1.7 | 2 |
| 2.3 | 2 |
| -1.8 | -2 |
Round to 1 decimal place:
datatable(val:real)[1.75, 2.34]
| extend rounded = round(val, 1) | val | rounded |
|---|---|
| 1.75 | 1.8 |
| 2.34 | 2.3 |
round
Rounds numbers to the nearest integer or specified precision.
Syntax
round(Number [, Precision]) Precisionis optional; when provided, rounds to that decimal place or power of 10.
Examples
Round to integer:
datatable(x:real)[1.2, 1.8]
| extend rounded = round(x) Round to hundredths:
datatable(x:real)[1.234, 5.678]
| extend rounded = round(x, 0.01)