Rounding

BB

Registered User.
Local time
Today, 21:52
Joined
Aug 31, 2001
Messages
30
I was doing this calculation =[Gallons][UnitAmt] and was
having trouble with it not rounding correctly. UnitAmt is
Currency; Gallons is Double(fixed, 1 decimal place). To
correct the problem, I think, I changed it to =CCur(NZ
([Gallons]*[UnitAmt])). I don't really understand why CCur
is correcting the problem. I used NZ because I was getting
#Error in the total field of the next record. I am using
Access97, but this is actually going to be used in 2000.
Is this the correct way to handle all of this??

Thanks, BB
 
Hullo,

maybe not the answer your looking for but . . . . . .

the only way i stop rounding problems is by formatting the number everytime i do the calculation. ie
x = format(number1, 0.00) + format(number2, 0.00)

this means that i am only ever doing the calulation to 2 decimal places.

it might work for you, it might not, suck it and see
smile.gif


regards
MrP
 
mostly it works because MS got it right for currency type fields...

some good info on the problem appears here:
http://www.fmsinc.com/tpapers/math/index.html

hth,
al


[This message has been edited by pcs (edited 12-14-2001).]
 

Users who are viewing this thread

Back
Top Bottom