Calculating with registers (amount of shares)

In a text i’m creating for ‘Notulen’ Im trying to calculate an amount in combination with the total amount of shares by using registers.

However, I can’t seem to find an easy way to solve this. So what I’ve done is using the following code in order to fill the register $6:

{% ic %}{% for x in period.shareholders %}<font color="white">{%=$6+ x.amount_of_shares%}</font>{% endfor %}{% endic %}

As I save the text it works and I can calculate with the register $6.
However, when I export this text, the register is empy and the calculation is wrong, probably due to te code {% ic %}{% endic %}. But clearly I don’t want the piece of code to show up on an export.

Is there a way to work around it?

This should do the trick

{% for x in period.shareholders %}{% $6+ x.amount_of_shares%}{% endfor %}{% ic %}{{$6}}{% endic %}

Kind regards

When I put that coe in, i get this result on

Looks to me the fontcolor is not working. I want to put the result in white because i dont want to let it show this dat on my screen when entering the template

I’ve already found it.

Before I used the code
{% for x in period.shareholders %}{%=$6+ x.amount_of_shares%}{% endfor %}

and the values of $6 were displayed, however when I use your code it works just fine

{% for x in period.shareholders %}{% $6+ x.amount_of_shares%}{% endfor %}

Thanks a lot!

Also I wanted to let you know that when using font color. You can’t use words like ‘white’ in liquid. It needs to be a hexadecimal rgb notation. For exemple white would be FFFFFF.