Skip to content

#roundTo

Returns a number rounded to the specified number of decimal places.

#roundTo(value, decimals)
Category NumbersValid in Property value
Name Type Description
value path | number The number to round.
decimals integer Decimal places to keep.

number

source.json
{
"pi": 3.14159
}
transformer.json
{
"result": "#roundTo($.pi, 2)"
}
output.json
{
"result": 3.14
}

Try it in the playground →