I'm scraping the screen to obtain some monetary values, annoyingly listed with commas, so I'm reading each "section" and appending them, skipping the commas.
I'm then adding them together and displaying them in a message box.
It seems that Extra basic can't add up!?
This is the code:
The output values in the message box on a test run are:
3487.97
0
100
0
0
3587.96997070313
How is 3487.97+100 resulting in a load of decimal places?!
Thanks in advance!
I'm then adding them together and displaying them in a message box.
It seems that Extra basic can't add up!?
This is the code:
Code:
net=Csng(trim((Sess0.Screen.GetString(6,66,3)+Sess0.Screen.GetString(6,70,3)+Sess0.Screen.GetString(6,74,6))))
pen=Csng(trim((Sess0.Screen.GetString(7,66,3)+Sess0.Screen.GetString(7,70,3)+Sess0.Screen.GetString(7,74,6))))
fee=Csng(trim((Sess0.Screen.GetString(8,66,3)+Sess0.Screen.GetString(8,70,3)+Sess0.Screen.GetString(8,74,6))))
arr=Csng(trim((Sess0.Screen.GetString(14,66,3)+Sess0.Screen.GetString(14,70,3)+Sess0.Screen.GetString(14,74,6))))
arrexvat=(arr/1.2)
cust=(net+pen+fee+arrexvat)
message$=(str$(net)+" "+str$(pen)+" "+str$(fee)+" "+str$(arr)+" "+str$(arrexvat)+" "+str$(cust))
MsgBox message$
The output values in the message box on a test run are:
3487.97
0
100
0
0
3587.96997070313
How is 3487.97+100 resulting in a load of decimal places?!
Thanks in advance!