Math.round
Math.round
Function
Rounding. Returns the rounded number.
Syntax
Math.round(value)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| value | Number | Yes | None | The number that participates in rounding. |
Return value
| Type | Description |
|---|---|
| Int/Float | Returns the rounded number. An Int is returned for integer results, and a Float for non-integer or non-finite results. |
Example
result = Math.round(1.6) // Output: 2 print result
Notes
- Integer results return Int.