How to determine whether a number or its calculation result can be used as a divisor in the Anqi CMS template?
divisibleby
The filter can determine whether a number or its calculation result can be used as a divisor. The filter will return a boolean value (bool), True means yes, and False means no.
How to use
divisibleby
How to use filters:
{{ number|divisibleby:Type value }}
For example, the following judgment21
use3
After taking the modulus, whether it can be used as a divisor can be written like this:
{{ 22|divisibleby:"3" }} # Show result False
Sample Demo
{{ 21|divisibleby:3 }} {{ 21|divisibleby:"3" }} {{ 21|float|divisibleby:"3" }} {{ 22|divisibleby:"3" }} {{ 85|divisibleby:42 }} {{ 84|divisibleby:42 }} # Show results True True True False True