Just for the record (and meaning no offense),
Works:
--------------
? (int(12.1234 / .1) * .1)
12.1
? (int(12.1799 / .1) * .1)
12.1
Unexpected Results:
---------------------
? (int(12.0 / .1) * .1)
11.9
? (int(12.0000000000000001 /.1) * .1)
11.9
One option (for Access versions that support CDec()):
------------------------------------------------------
? (int(CDec(12.0) /CDec(.1)) * CDec(.1))
12
? (int(CDec(12.0000000000000001) /CDec(.1)) * CDec(.1))
12
You may only need to use CDec in division
? (int(CDec(12.1234) /CDec(.1)) * .1)
12.1
? (int(CDec(12.199999) /CDec(.1)) * .1)
12.1
? (int(CDec(12.09999) /CDec(.1)) * .1)
12
? (int(CDec(12.0000000000000001) /CDec(.1)) * .1)
12
but you might use var in FLOOR function
to change Precision to Dec, then could use
var in both places.
I believe it is only the division and subtraction
of non-integers where this is a problem. To make
sure I'm not wrong, it would not hurt to read:
When Access Math Doesn't Add Up
by Luke Chung President of FMS
http://www.fmsinc.com/tpapers/math/index.html
Again, meaning no offense.
Gary Walter