Determine if a number can be used as a divisor

How to judge whether a number or its calculation result can be a divisor in 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, False means no.

Usage method

divisiblebyHow to use the filter:

{{ number|divisibleby:取模值 }}

For example, the judgment below21using3After taking the modulus, if it can be the dividend, it can be written like this:

{{ 22|divisibleby:"3" }}
# 显示结果
False

Example Demonstration

{{ 21|divisibleby:3 }}
{{ 21|divisibleby:"3" }}
{{ 21|float|divisibleby:"3" }}
{{ 22|divisibleby:"3" }}
{{ 85|divisibleby:42 }}
{{ 84|divisibleby:42 }}
# 显示结果
True
True
True
False
False
True