# Unless statement with percentage input

**URL:** <https://community.silverfin.com/t/unless-statement-with-percentage-input/1982>\
**Category:** Templates\
**Created:** [December 18, 2020, 6:10pm UTC](https://community.silverfin.com/t/unless-statement-with-percentage-input/1982 "2020-12-18T18:10:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Megan](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@Megan](https://community.silverfin.com/u/Megan)\
**Post date:** [December 18, 2020, 6:10pm UTC](https://community.silverfin.com/t/unless-statement-with-percentage-input/1982/1 "2020-12-18T18:10:07Z")

</div>

Hi,

I’m trying to make it so the second question only appears when the % entered is less than 100. I could get this to work when the input field was set as a ‘number’, but now I’ve changed it to a ‘percentage’ I’m not sure what to change to make it work. The relevant section of code copied below. Thanks

|File completion percentage at the date noted above  
| {% input custom.completion.percentage as:percentage precision:0 %}  
|{% unless custom.completion.percentage \< 100 %}  
{%else%}  
{% newline %}  
|Provide reason as to why not at 100%  
|{% input custom.reason.why as:text placeholder:‘reason’ %}  
{% endunless %}  
{% newline %}  
|Generate an export of the working papers, and save here, using the date noted above as the file name  
|{% input custom.working.papers as:file %}  
{% newline %}

---

<div class="post-metadata">

**Author:** ![Jelena\_Sutova](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.silverfin.com/jelena_sutova/32/599_2.png) [@Jelena\_Sutova](https://community.silverfin.com/u/Jelena_Sutova)\
**Post date:** [December 19, 2020, 3:32pm UTC](https://community.silverfin.com/t/unless-statement-with-percentage-input/1982/2 "2020-12-19T15:32:43Z")

</div>

@Megan

Thank you for your question.

A percent can be expressed as Decimal or fraction. For example:

- As a percentage: 50%
- As a decimal: 0.5
- As a fraction: 1/2

100% is 1

System stores variables as numbers, it means 100% is stored as 1 (10% as 0.1, 1% as 0.01).

In your formula comparison should be with 1 instead of 100:

> {% unless custom.completion.percentage \< 1 %}

Please let me know if this works.

Jelena

---

<div class="post-metadata">

**Author:** ![Megan](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@Megan](https://community.silverfin.com/u/Megan)\
**Post date:** [December 20, 2020, 3:20pm UTC](https://community.silverfin.com/t/unless-statement-with-percentage-input/1982/3 "2020-12-20T15:20:14Z")

</div>

Hi Jelena,

Thanks so much - it is now working exactly as it should be.

Nice and simple solution that I’ll know for next time.

Many thanks again,

Megan
