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