# Assign numbers to sections

**URL:** <https://community.silverfin.com/t/assign-numbers-to-sections/1584>\
**Category:** Templates\
**Tags:** assign\
**Created:** [October 15, 2019, 7:29am UTC](https://community.silverfin.com/t/assign-numbers-to-sections/1584 "2019-10-15T07:29:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefan.Temelie](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Stefan.Temelie](https://community.silverfin.com/u/Stefan.Temelie)\
**Post date:** [October 15, 2019, 7:29am UTC](https://community.silverfin.com/t/assign-numbers-to-sections/1584/1 "2019-10-15T07:29:29Z")

</div>

Hi,

I have 18 sections in a template I have developed. I want to assign a number to each section when it is activated ( with a thick) .  
I am able to give a number to each section up to number 9 with the code bellow. After number 9 I am unable to continue with number 10, 11 … 18.

```auto
{% assign section = '1234567891012' %}
{% assign nr = 12 %}
 
{% ic %}{% input custom.tick.section_A as:boolean %}{% endic %}{% if custom.tick.section_A %}|{::font size="m"}**{{ section | slice:0 }}{% assign nr = nr | minus:1 %}{% assign section = section | slice:1,nr %}) Sales ledger**{:/font}| {% assign nr = nr | plus:1 %}{% else %}|{% ic %}{::font size="m"} Sales ledger{:/font}{% endic %}{% endif %} 

```

Can you please let me know how can I fix this code in order to display numbers above 9 ?

Thank you,  
Stefan

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [October 15, 2019, 8:20am UTC](https://community.silverfin.com/t/assign-numbers-to-sections/1584/2 "2019-10-15T08:20:10Z")

</div>

Hi @Stefan.Temelie,

Welcome to our community!

I would do it differently though, like his:

```auto
{% comment %}create separate var when boolean is ticked off{% endcomment %}
{% assign sections = "Sales ledger|Costs ledgers|Assets ledgers" | split:"|" %}
{% assign nbr = 0 %}

{% stripnewlines %}
  {% for item in sections %} {% comment %}loop over all sections{% endcomment %}
    {% newline %}
    {% if custom[item].section == true %}
      {% assign nbr = nbr | plus:1 %} *{{ nbr }}* {% comment %}create var that counts as soon as a boolean is ticked off{% endcomment %}
    {% endif %}
    {% ic %}{% input custom[item].section as:boolean %}{% endic %} **{{ item }}**
  {% endfor %}
{% endstripnewlines %} 

```

Means some lesser code; we use the system of creating a var that adds one as soon as something is checked off, in our legal reports as well.

Is this something you can work on further?

---

<div class="post-metadata">

**Author:** ![Stefan.Temelie](https://avatars.discourse-cdn.com/v4/letter/s/b9e5f3/32.png) [@Stefan.Temelie](https://community.silverfin.com/u/Stefan.Temelie)\
**Post date:** [October 15, 2019, 8:41am UTC](https://community.silverfin.com/t/assign-numbers-to-sections/1584/3 "2019-10-15T08:41:30Z")

</div>

Thank you for your reply.  
I am pretty new at this. I will give it a try later.

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [October 15, 2019, 8:43am UTC](https://community.silverfin.com/t/assign-numbers-to-sections/1584/4 "2019-10-15T08:43:07Z")

</div>

No worries, we are here to help! 💪

---

<div class="post-metadata">

**Author:** ![sven](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/sven/32/1495_2.png) [@sven](https://community.silverfin.com/u/sven)\
**Post date:** [October 17, 2019, 2:29pm UTC](https://community.silverfin.com/t/assign-numbers-to-sections/1584/5 "2019-10-17T14:29:26Z")

</div>

Closed on October 17, 2019, 2:29pm UTC


