Math filters allow you to perform mathematical operations on numbers.

As with all filters, math filters can be chained, and are applied in order from left to right.

Code
{{ 10 | times: 2 | minus: 5 | divided_by: 3 }}
Output
5

ceil

Rounds a value up to the nearest integer.

Code
{{ 4.6 | ceil }}
{{ 4.3 | ceil }}
Output
5
5

divided_by

Divides a number by another number.

Code
{{ 10 | divided_by: 2 }}
{{ 10 | divided_by: 3 }}
{{ 10.0 | divided_by: 3 }}
Output
5
3
3.333333

floor

Rounds a value down to the nearest integer.

Code
{{ 4.6 | floor }}
{{ 4.3 | floor }}
Output
4
4

minus

Subtracts a number from another number.

Code
<!-- entityview.page = 11 -->
{{ entityview.page | minus: 1 }}
{{ 10 | minus: 1.1 }}
{{ 10.1 | minus: 1 }}
Output
10
9
9.1

modulo

Divides a number by another number and returns the remainder.

Code
{{ 12 | modulo: 5 }}
Output
2

plus

Adds a number to another number.

Code
<!-- entityview.page = 11 -->
{{ entityview.page | plus: 1 }}
{{ 10 | plus: 1.1 }}
{{ 10.1 | plus: 1 }}
Output
12
11
11.1

round

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

Code
{{ 4.6 | round }}
{{ 4.3 | round }}
{{ 4.5612 | round: 2 }}
Output
5
4
4.56

times

Multiplies a number by another number.

Code
{{ 10 | times: 2 }}
{{ 10 | times: 2.2 }}
{{ 10.1 | times: 2 }}
Output
20
20
20.2