round

Round a floating point number to the nearest integer or specified decimal places.

Syntax

{{ number | round: decimals }}

Example

{% assign rating = 4.867 %}{{ rating | round: 1 }} Stars

Output

4.9 Stars

The round filter rounds floating point decimal numbers to the nearest whole integer or to a specified number of decimal places when an optional argument is supplied. It uses standard half-up arithmetic rounding.

In programmatic SEO directories, round formats review score averages and percentage discounts into clean, trustworthy badges. For example: {{ row.aggregate_rating | round: 1 }} out of 5 stars based on verified local customer reviews. This avoids displaying unformatted floating point decimals like 4.8666667, maintaining visual polish.

Try this syntax in the editor.