How to add two numbers or strings in AnqiCMS template?
add
How can a filter add two numbers or strings.add
Usage Instructions
add
How to use the filter:
{{ obj|add:obj2 }}
For example, to transform5
Add2
then it can be written like this:
{{ 5|add:2 }}
# 显示结果
7
Here is an example demonstration
{{ 5|add:2 }}
{{ 5|add:40 }}
{{ 5|add:nothing }}
{{ 5|add:"CMS" }}
{{ "安企"|add:"CMS" }}
{{ "安企"|add:"2" }}
# 显示结果
7
47
5
5CMS
安企CMS
安企2