# How to increase environment variable when the value is a number?

**URL:** <https://community.postman.com/t/how-to-increase-environment-variable-when-the-value-is-a-number/41497>\
**Category:** Help Hub\
**Tags:** variables\
**Created:** [November 27, 2022, 10:09am UTC](https://community.postman.com/t/how-to-increase-environment-variable-when-the-value-is-a-number/41497 "2022-11-27T10:09:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyortush\_13](https://avatars.discourse-cdn.com/v4/letter/k/5fc32e/32.png) [@Kyortush\_13](https://community.postman.com/u/Kyortush_13)\
**Post date:** [November 27, 2022, 10:09am UTC](https://community.postman.com/t/how-to-increase-environment-variable-when-the-value-is-a-number/41497/1 "2022-11-27T10:09:39Z")

</div>

How to increase environment variable when the value is a number?  
Environment variables do not have variable types as far as I know.

For example, I have an environment variable NumOfLoops = 10.  
How can I set the value to: NumOfLoops = NumOfLoops + 1?

Thanks a lot!!!

---

<div class="post-metadata">

**Author:** ![pranavdavar](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/pranavdavar/32/9152_2.png) [@pranavdavar](https://community.postman.com/u/pranavdavar)\
**Post date:** [November 28, 2022, 7:31am UTC](https://community.postman.com/t/how-to-increase-environment-variable-when-the-value-is-a-number/41497/2 "2022-11-28T07:31:21Z")

</div>

Hi @Kyortush_13, Welcome to the Community!

Postman stores env variables as strings. In order to perform arithmetic operations on env variables, you need first to parse it as Int then add and again set variable env variable. Please find the below snippet for reference.

Assuming the initial value is stored in variable **a**.

`pm.environment.set("a",parseInt(pm.environment.get("a"))+1);`
