Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Given an array of { name: string; amount: float }, how does one write out the data running total.
{ name: string; amount: float }
{% for entry in my_array %} {{ entry.name }}, {{ entry.amount }}, {{ ???running total??? }} {% endfor %}
这是你要找的吗?
{% assign running_total = 0 %} {% for entry in my_array %} {% assign running_total = running_total | plus: entry.amount %} {% endfor %}