Determine whether a number can be used as a divisor

How to determine whether a number or its calculation result can be used as a divisor in the Anqi CMS template?

divisiblebyThe 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

divisiblebyHow to use filters:

{{ number|divisibleby:Type value }}

For example, the following judgment21use3After 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