# Looking to do a simple calculation

**URL:** <https://community.postman.com/t/looking-to-do-a-simple-calculation/23843>\
**Category:** Help Hub\
**Created:** [May 18, 2021, 10:49am UTC](https://community.postman.com/t/looking-to-do-a-simple-calculation/23843 "2021-05-18T10:49:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![v.verhulst](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@v.verhulst](https://community.postman.com/u/v.verhulst)\
**Post date:** [May 18, 2021, 10:49am UTC](https://community.postman.com/t/looking-to-do-a-simple-calculation/23843/1 "2021-05-18T10:49:36Z")

</div>

Hi,

I’m running a script which gets some data from api 1, puts into variables and then uses those variables in a XML post API.  
Sadly some things have changed and the value I get from api 1 is no longer import-ready for the XML Api. I would have to do a simple calculation.

Var 1 \* var 2 results in var 3.

I know how to populate var 1 and 2, but I can’t figure out how I should do a simple calculation (for now it’s a \* but could also be / or +).  
Do I need to use an external api to do this?

---

<div class="post-metadata">

**Author:** ![v.verhulst](https://avatars.discourse-cdn.com/v4/letter/v/ecae2f/32.png) [@v.verhulst](https://community.postman.com/u/v.verhulst)\
**Post date:** [May 18, 2021, 2:00pm UTC](https://community.postman.com/t/looking-to-do-a-simple-calculation/23843/2 "2021-05-18T14:00:31Z")

</div>

I’ll be using an external mathJS api to do this. If any other options, always welcome.

---

<div class="post-metadata">

**Author:** ![bpricilla](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/bpricilla/32/6511_2.png) [@bpricilla](https://community.postman.com/u/bpricilla)\
**Post date:** [May 18, 2021, 11:32pm UTC](https://community.postman.com/t/looking-to-do-a-simple-calculation/23843/3 "2021-05-18T23:32:37Z")

</div>

Hi @v.verhulst,

Yes, you can write your own functions to do the math for you 🤩

Please check my [public workspace](https://www.postman.com/bpricilla/workspace/pricilla-s-api-space/request/12539800-1c832834-02e6-4b3e-9047-64cae591d52c),

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/1/b/1b6e07fad0a6e24019782a0b1145ef212858fc46.png)

This might be useful, give it a try. Waiting to hear from you!!
