-
for example, i want to set pos= pos + field.length data {
"fields":[
{
"name":"number_field",
"length":1
},
{
"name":"text_field",
"length":2
},
{
"name":"validate",
"length":3
}
]
} template {% assign pos = 0 -%}
{% for field in fields %}
{{ field.name }} length: {{ field.length }} [{{ pos }}, {{ field.length | plus: pos | plus: -1 }}]
{% # pos= pos + field.length %}
.....
{% endfor %} |
Beta Was this translation helpful? Give feedback.
Answered by
harttle
May 19, 2023
Replies: 1 comment 1 reply
-
Try this: {% assign pos = pos | plus: field.length %} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zls3201
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try this: