I guess I'm missing something here.
When I open the Immediate Window (Ctrl+G) and enter:
? -Int(- 100 * 1.52001) / 100
on my computer Access respond with:
1.53
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Not quite it, but I've got you thinking
Given the example above (1.52001), this needs to round UP to 1.53
(because of the .00001).
You can't always add .01 to all amounts, incase it comes out to an even
penny amount (2.50), it would round up a penny when it shouldn't
Still thinking I'll have to read the length of remainder, if it's
greater than 2, then add .01... just don't know how...
Allen Browne wrote:
How about:
-Int(- 100 * [Amount]) / 100
Multiply by 100.
Negate.
Int() now rounds down to the nearest penny.
Negate again.
The double-negation has the effect of rounding in the opposite
direction
to
what Int() normally does.
Int() is exactly the opposite of what I need... instead of pulling
the
integer, I need something that returns the decimal numbers... This
sounds like it should be so easy...
For example:
Int (210.67) would return 210
Int (2.98) would return 2
I need something that:
(210.67) would return 67
(2.98784) would return 98784
Lea wrote:
Something that might work, in theory (I haven't tried it out
myself):
Int() function is supposed to round down, possibly to the specified
number
of decimals in the same fashion that Round() does; if so, perhaps
set
the
function to round all your values down, then immediately add .01?
Hope this helps.
"Lord Madrid" wrote: