We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
20230111
Linux
Docker/Linux 64位
因为if、for循环系统标识中已包含%,导致判断条件不能使用‘%’计算取余数,如下: {% if days|int % 7 == 0 %}
取余符号跟{%标识冲突
No response
<class 'TypeError'>: "unsupported operand type(s) for %: 'type' and 'int'" while evaluating 'days|int % 7 == 0 '
希望可以增加‘%’取余计算逻辑
The text was updated successfully, but these errors were encountered:
使用 {% if int(days) % 7 == 0 %}
{% if int(days) % 7 == 0 %}
在if判断里使用int(days)来将str转换为整数
int(days)
str
Sorry, something went wrong.
这种方式也使用过了,同样报错,错误如下(我感觉是因为%的关系):
在if判断里使用int(days)来将str转换为整数 这种方式也使用过了,同样报错,错误如下(我感觉是因为%的关系):
暂时只支持在 if API里使用 int(days), 其他地方请使用 {{days|int % 7}}
if
{{days|int % 7}}
已经解决,谢谢王哥
fix #374
99c65ce
No branches or pull requests
Verify steps
QianDao Version
20230111
Bug on OS
Linux
Bug on Platform
Docker/Linux 64位
To Reproduce
因为if、for循环系统标识中已包含%,导致判断条件不能使用‘%’计算取余数,如下:
{% if days|int % 7 == 0 %}
Describe the Bug
取余符号跟{%标识冲突
QianDao config
No response
QianDao log
Expected behavior
希望可以增加‘%’取余计算逻辑
Screenshots
No response
The text was updated successfully, but these errors were encountered: