TypstDocumentation

round

Round a number to the nearest integer.

Optionally, a number of decimal places can be specified.

Example

#assert(calc.round(3.14) == 3)
#assert(calc.round(3.5) == 4)
#calc.round(3.1415, digits: 2)
Preview

Parameters
Question mark

value
integerfloatRequiredPositional
Question mark

The number to round.

digits