Forum Discussion

hsdhillon's avatar
hsdhillon
Occasional Contributor
8 years ago

How can I keep the double values as it is e.g. 5.00 instead of 5 and 5.50 instead of 5.5.

I want to compare 2 double values, one saved from website into the variable using Object Property, second coming from python script which I use to calculate tax. Whenever I save the value into a variable running a python script, TC takes off the zero's after decimal point. e.g 5.00 turns to 5 and 5.50 turns to 5.5. I want to keep the value as 5.00 or 5.50 so I can compare the two numbers. How do I do that? I tried using the "round()" & float() methods but this did not work.
 I also tried converting it to double using the "toDouble" method but that did not work either

2 Replies

    • hsdhillon's avatar
      hsdhillon
      Occasional Contributor

      Thank you for your response Marsha, good point. I have created all variable as String. I thought I found the solution for it using aqConvert.StrToFloat() method or by using float() method, but whenever multiplying two values, output comes remove the last zero. e.g. 25*0.18 = 4.5 instead of 4.50