Skip to main content

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

NameTypeRequired
inputnumber
precisionnumber (Default: 1)

Outputs

NameType
resultnumber
errorNaNstring

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"