# Integer comparison if condition jinja2 template Ansible does not work

**URL:** <https://forum.ansible.com/t/integer-comparison-if-condition-jinja2-template-ansible-does-not-work/32542>\
**Category:** Ansible Project\
**Created:** [March 26, 2020, 6:21pm UTC](https://forum.ansible.com/t/integer-comparison-if-condition-jinja2-template-ansible-does-not-work/32542 "2020-03-26T18:21:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shifa\_Shaikh](https://avatars.discourse-cdn.com/v4/letter/s/b2d939/32.png) [@Shifa\_Shaikh](https://forum.ansible.com/u/Shifa_Shaikh)\
**Post date:** [March 26, 2020, 6:21pm UTC](https://forum.ansible.com/t/integer-comparison-if-condition-jinja2-template-ansible-does-not-work/32542/1 "2020-03-26T18:21:17Z")

</div>

My jinja2 template yields correct value for the variable

`{{ vars[[allip.name](http://allip.name/) | join("")] | default('ERR') }}`

The variable has value 82.3 which gets printed by Ansible’s template module.

I wish to write an if condition where I want to check if the value of the variable is more than 80

`{% if ( vars[[allip.name](http://allip.name/) | join("")] | int ) > 80 %}`

`<th>MORE THAN 80</th>`

`{% endif %}`

However, the ‘if’ the condition does not meet.

I tried

`{% if ( vars[[allip.name](http://allip.name/) | join("")] | int > 80 ) %}`

I also tried

`{% if vars[[allip.name](http://allip.name/) | join("")] | int > 80 %}`

But, none of them worked. Can you please let me know what needs to be done to meet the if condition?
