v1.9.1
Divides a number by another number. The result is the string obtained by JavaScript .toString()
of the result number.
Input
{{ 16 | divided_by: 4 }}
Output
4
Input
{{ 5 | divided_by: 3 }}
Output
1.6666666666666667
In JavaScript, float and integer shares the same type number
and we cannot tell the difference. For example:
// always true
5.0 === 5
You’ll need to pass another integerArithmetic
argument to enforce integer divide:
Input
{{ 5 | divided_by: 3, true }}
Output
1