Round

The round filter allows us round a number to a specified number of decimal places.

Arguments

The filter has one argument decimals.

This value controls to how many decimal places the value will be rounded to.

If a value is not specified, 2 decimal places is the default

Example Usage

Example 1

Where aNumber = 3.33333333

{ aNumber | round }

Will output:

3.33

Example 2

Where aNumber = 8.88888888

{ aNumber | round }

Will output:

8.89

Example 3

Where aNumber = 8.88888888

{ aNumber | round:4 }

Will output:

8.8889