round
number | round
returns number
Rounds a number to the nearest integer.
{{ 2.7 | round }}
{{ 1.3 | round }}
Code
{{ 2.7 | round }}
{{ 1.3 | round }}Output
3
1
Output
3
1Anchor to Round to a specific number of decimal places
Round to a specific number of decimal places
You can specify a number of decimal places to round to. If you don't specify a number, then the round filter rounds to the nearest integer.
{{ 3.14159 | round: 2 }}
Code
{{ 3.14159 | round: 2 }}Output
3.14
Output
3.14Was this page helpful?