Link to home
Start Free TrialLog in
Avatar of FTIISD
FTIISD

asked on

Subtraction using double

Hi,

Im am running the following code:
frmAddToFile.txtBalance = Val(frmAddToFile.adoFileInformation.Recordset.Fields("saleamount")) - Val(frmAddToFile.txtTotalPaidToDate) - Val(txtAmountPaying.Text)

where frmAddToFile.adoFileInformation.Recordset.Fields("saleamount") = 10707.49
and frmAddToFile.txtTotalPaidToDate = 8022.89
and txtAmountPaying.Text = 2684.60

this should compute to 0 but instead it = -4.54747350.......

I understand this has to do with the way it is stored in binary, but I need a way of making this work.

Thanks!
SOLUTION
Avatar of Shauli
Shauli

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of prasitlee
prasitlee

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of FTIISD
FTIISD

ASKER

Was able to get it working with CCur()

Thanks for the help!