Scratch for Java

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

View on GitHub

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

round()

Create Shareable URL

Select Sections