p_mariet
11 years agoOccasional Contributor
Testcomplete subsctraction problem VBScript
Hello,
I'm having a hard time with a simple substraction in Testcomplete (I know that sounds a bit stupid...).
Here is an example:
Dim one, two
one = (79.10 - 67.80)
two = 11.3
If one = two then
Call Log.Message("yes")
Else
Call Log.Error("no")
End if
Here, one and two are identical (both = 11.3), they are also assigned to the Double type. But when I execute this part I get the "no" message returned even thought they are the same.
They are somehow not identical for Testcomplete but I have no idea why. Has anyone encountered a similar problem?
Thank you
I'm having a hard time with a simple substraction in Testcomplete (I know that sounds a bit stupid...).
Here is an example:
Dim one, two
one = (79.10 - 67.80)
two = 11.3
If one = two then
Call Log.Message("yes")
Else
Call Log.Error("no")
End if
Here, one and two are identical (both = 11.3), they are also assigned to the Double type. But when I execute this part I get the "no" message returned even thought they are the same.
They are somehow not identical for Testcomplete but I have no idea why. Has anyone encountered a similar problem?
Thank you
- Working with float types is always a bottleneck in scripting language.
I am not an expert in this and can't explain why exactly this example works like this, but I've found a solution for you
Dim one, two
one = Round(79.10 - 67.80, 2)
two = Round(11.30, 2)