# variable string to integer

**URL:** <https://forum.katalon.com/t/variable-string-to-integer/25592>\
**Category:** Miscellaneous\
**Tags:** web-testing, katalon-studio\
**Created:** [May 17, 2019, 2:08pm UTC](https://forum.katalon.com/t/variable-string-to-integer/25592 "2019-05-17T14:08:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rythie72](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@rythie72](https://forum.katalon.com/u/rythie72)\
**Post date:** [May 17, 2019, 2:08pm UTC](https://forum.katalon.com/t/variable-string-to-integer/25592/1 "2019-05-17T14:08:33Z")

</div>

want to take a variable in one web page in the string mode and transform it to usable variable and make a calculation is mind add taxes to this variable and verified the results please

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [May 17, 2019, 2:46pm UTC](https://forum.katalon.com/t/variable-string-to-integer/25592/2 "2019-05-17T14:46:35Z")

</div>

If you plan on doing calculations with non-integer numbers (especially when dealing with money), you should convert to BigDecimal:

```
BigDecimal price = new BigDecimal(“9.99”)
BigDecimal tax = new BigDecimal(“0.30”)
BigDecimal total = price.add(tax)
```

---

<div class="post-metadata">

**Author:** ![rythie72](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@rythie72](https://forum.katalon.com/u/rythie72)\
**Post date:** [May 17, 2019, 4:20pm UTC](https://forum.katalon.com/t/variable-string-to-integer/25592/3 "2019-05-17T16:20:04Z")

</div>

thanks for your answer but : i want to open this web take the number and make thj calculation for found the taxe please  
[https://lexusmontreal.ca/explore/es?gclid=EAIaIQobChMI2auzzfmi4gIVg43ICh0hJAn4EAAYASAAEgLstvD\_BwE](https://lexusmontreal.ca/explore/es?gclid=EAIaIQobChMI2auzzfmi4gIVg43ICh0hJAn4EAAYASAAEgLstvD_BwE)’)

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [May 17, 2019, 5:01pm UTC](https://forum.katalon.com/t/variable-string-to-integer/25592/4 "2019-05-17T17:01:53Z")

</div>

I answered your original question assuming that you already retrieved the values that you wanted from the web page. Your question was how to convert those values to variables which you could perform arithmetic on. If you are having trouble getting the values from the web page, you should post a different question.

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:48am UTC](https://forum.katalon.com/t/variable-string-to-integer/25592/5 "2022-08-08T07:48:59Z")

</div>

Archived on August 8, 2022, 7:48am UTC


