Thanks:  0
Likes:  0
Dislikes:  0

# Thread: Working with numbers ???

1. ## Working with numbers ???

Do you know how I can execute the following function and obtain the result 0.01 ?

A = 1987.00
B = 1987.01

R = B - A

MessageBox("", R, "Ok")

When I executed this function, the result showed was 9.9999999999909e-003

2. ## Re: Working with numbers ???

scorpion_tester,

You asked a similar question in October last year.

It was suggested then that this appeared to be the way QARun handled numbers &lt;1 and you should contact Compuware Tech Support.

I doubt anyone can give you any more guidance than they could then.

It would be helpful if you could report back what response you get from Compuware Tech Support.

Regards

3. ## Re: Working with numbers ???

Here is an example that will work for your numbers supplied. It will need to be modified to work with all numbers.

I can't give you the complete answer for free or I might put myself out of work...but this should get you started.

A = "1987.00"
B = "1987.01"

A = A * 100
B = B * 100

C = A - B
LengthC = Length(C)

If C &gt; 0
If LengthC = 1
C = "" + "0.0" + C
Elseif LengthC = 2
C = "" + "0." + C
Else
C = "" + C
Endif
Else

C = ABS(C)
LengthC = Length(C)

If LengthC = 2
C = "" + "-0." + C
Elseif LengthC = 1
C = "" + "-0.0" + C
Else
C = "" + "-" + C
Endif
Endif

MessageBox("", C, "Ok")

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.