# Making totals with registers

**URL:** <https://community.silverfin.com/t/making-totals-with-registers/552>\
**Category:** Templates\
**Tags:** math, register\
**Created:** [December 21, 2017, 2:05pm UTC](https://community.silverfin.com/t/making-totals-with-registers/552 "2017-12-21T14:05:57Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Cedric](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Cedric](https://community.silverfin.com/u/Cedric)\
**Post date:** [December 21, 2017, 2:37pm UTC](https://community.silverfin.com/t/making-totals-with-registers/552/3 "2017-12-21T14:37:30Z")

</div>

Thanks @Sam.

Any idea how I can solve it with this code?  
Here I made a fori loop (as I asked earlier today). In every loop, I want the total of only this loop, but I also want to make an overall total that needs to be put in the first row of the table…

````auto
{{ header }}
|Kinderopvang||| {{ $0 | currency }}

{{ header }}
{% stripnewlines %}{% fori kinderopvang in custom.kinderopvang %}
||{% input kinderopvang.naam %}|
{% newline %}
||Aantal dagen|{% $1+input kinderopvang.dagen %}||
{% newline %}
||Bedrag per dag|{% $2+input kinderopvang.bedragperdag as:currency %}||
{% newline %}
||Bedrag beperkt|{% $3+input kinderopvang.bedragbeperkt default:"11,20" as:currency %}||
{% newline %}
||Totaal aftrekbaar|{% if $2 > $3 %} {% $0+ $1*$3 as:currency %} {% else %} {% $0+ $2*$3 as:currency %}{% endif %} {{ $0 }}
{% newline %}{% endfori %}
{% endstripnewlines %}```
````

---

_[View the full topic](https://community.silverfin.com/t/making-totals-with-registers/552)._
