Operators::round()
The standard rules of rounding are followed; decimals that are .5 or higher are rounded up, whereas decimals less than .5 are rounded down.
Examples
Syntax
Java
.round(x)
.round(x, precision)
Scratch
(round (x))
Parameters
| Name | Data Type | Description |
|---|---|---|
| x | double | a value |
| precision | int | the number of decimal places to round to |
Return
int