round Filter

Rounds a number to the nearest integer or specified number of decimals.

Parameters

Parameter Required Description
precision No integer Number of decimals to round to.

Category

Math Filters

Description

Rounds a number to the nearest integer. Or pass the precision parameter to specify a number of decimals to round to.

Example: without a precision parameter
{{ 4.54 | round }}

Output

5
Example: with a precision parameter
{{ 4.5 | round: 1 }}

Output

4