Round
Module Info:
moduleType: "internal",
moduleName: "round"
Description
The round
function rounds a number to the nearest value within the given precision. If no precision is given, a precision of 1
will be used.
Inputs
Name | Type | Required |
---|---|---|
input | number | ✔ |
precision | number | ✖ (Default: 1 ) |
Outputs
Name | Type |
---|---|
result | number |
errorNaN | string |
The errorNaN
property will only be defined if either input
or precision
are not numbers.
Examples
Inputs | Outputs | ||
---|---|---|---|
input | precision | result | errorNaN |
3.435 | 0.5 | 3.5 | undefined |
3.435 | undefined | 3 | undefined |
3.435 | 0.2 | 3.4 | undefined |
3.435 | "foo" | undefined | "One of the arguments provided was not a number" |