# Default values for percentage input not visible in iteration

**URL:** <https://community.silverfin.com/t/default-values-for-percentage-input-not-visible-in-iteration/2058>\
**Category:** Templates\
**Created:** [March 24, 2021, 12:00pm UTC](https://community.silverfin.com/t/default-values-for-percentage-input-not-visible-in-iteration/2058 "2021-03-24T12:00:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panagiotis\_Issaris](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/panagiotis_issaris/32/1138_2.png) [@Panagiotis\_Issaris](https://community.silverfin.com/u/Panagiotis_Issaris)\
**Post date:** [March 24, 2021, 12:01pm UTC](https://community.silverfin.com/t/default-values-for-percentage-input-not-visible-in-iteration/2058/1 "2021-03-24T12:01:00Z")

</div>

Hi,

When using the following code, the default percentage appears in the output:

> {% assign total = 500 %}  
> {% assign part = 25 %}  
> {% assign pct = part/total %}  
> Total {{ total }}  
> Total {{ part }}  
> Pct {{ pct }}  
> Pct formatted {{ pct|percentage }}  
> {% input custom.ic.ic\_test\_pct as:percentage default:pct %}  
> Input pct: {{ custom.ic.ic\_test\_pct }}

However, when doing basically the same thing in an iteration, it will not appear:

> {% for person in period.people %}  
> {% $0+ person.amount\_of\_shares %}  
> {% endfor %}  
> {% assign total\_amount\_of\_shares = $0 %}
> 
> {% for person in period.people %}
> 
> {{ person.name }}
> 
> {% assign amount\_of\_shares = person.amount\_of\_shares | plus: 0 %}  
> Amount of shares: {{ amount\_of\_shares }}
> 
> {% assign pct\_of\_shares = amount\_of\_shares/total\_amount\_of\_shares %}  
> Percentage of shares : {{ pct\_of\_shares }}
> 
> Percentage of shares (formatted): {{ pct\_of\_shares | percentage }}
> 
> {% input person.custom.ic\_ubo\_pct\_of\_shares as:percentage default=pct\_of\_shares %}  
> {% input custom.ic.ic\_ubo\_pct\_of\_shares as:percentage default=pct\_of\_shares %}
> 
> {% endfor %}

Any help is appreciated.

With friendly regards,  
Takis

---

<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:** [March 24, 2021, 12:04pm UTC](https://community.silverfin.com/t/default-values-for-percentage-input-not-visible-in-iteration/2058/2 "2021-03-24T12:04:16Z")

</div>

Hi @Panagiotis_Issaris,

Your default attribute needs to be coded as:

```auto
{% input person.custom.ic_ubo_pct_of_shares as:percentage default:pct_of_shares %}
{% input custom.ic.ic_ubo_pct_of_shares as:percentage default:pct_of_shares %} 

```

so as:

> default:some\_var

and not with a `=`

Could you try again?

PS if you need to check values of shareholders, it is better to loop over `period.shareholders` instead of `period.people` 😉

---

<div class="post-metadata">

**Author:** ![Panagiotis\_Issaris](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/panagiotis_issaris/32/1138_2.png) [@Panagiotis\_Issaris](https://community.silverfin.com/u/Panagiotis_Issaris)\
**Post date:** [March 24, 2021, 12:06pm UTC](https://community.silverfin.com/t/default-values-for-percentage-input-not-visible-in-iteration/2058/3 "2021-03-24T12:06:22Z")

</div>

Hi Sven,

Oh! A typo… I should have seen that… it was driving me mad that it worked in the small template, and failed in the large one 😛

Thanks!!!

And thanks for the suggestion! 🙂

---

<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:** [March 24, 2021, 12:08pm UTC](https://community.silverfin.com/t/default-values-for-percentage-input-not-visible-in-iteration/2058/4 "2021-03-24T12:08:35Z")

</div>

I’ve been there as well, so 😌

---

<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:** [March 24, 2021, 12:08pm UTC](https://community.silverfin.com/t/default-values-for-percentage-input-not-visible-in-iteration/2058/5 "2021-03-24T12:08:48Z")

</div>


