Addition in a fori

Hi,

Is it possible to addition different calculated amounts in a fori?

In this case, I multiply 2 numbers. All the calculated numbers need to be shown.
At the bottom I need an addition of all the calculated numbers

Kinds regards,
Loïc

Hi Loïc

Thank you for your question.

Yes, it is possible. Here is an example of code.
Please let me know if you need further help.

    {% stripnewlines %}
    {% fori item in custom.numbers %}
    
    {% if forloop.first %}
    | Header 1| Header 2| Header 3{% newline %}
    |---33%---:|---33%--:|--34%---:+{% newline %}
    {% endif %}
    
    |{% input item.number1 as:currency_dc default:0 %}
    |{% input item.number2 as:currency_dc default:0 %}
    |{%=$1+ item.number1*item.number2 %}
    {% newline %}
    
    {% if forloop.last %}
    {% comment %}Total amount{% endcomment %}
    |
    |
    |^ **{{ $1 | currency_dc }}**^
    {% endif %}
    
    {% endfori %}
    {% endstripnewlines %}

Thanks.
Jelena