rounding of # on my report

B

bob

I have a report- Invoice where I want the decimal places
to be out to 2. I have 1 invoice that is baffling me.
Here goes.

total product $105.00
total freight $214.00
Tax of product
at .065(6.5%) $6.82

Total amt. Due 325.83

when I put them out to 3 decimal places the 6.82 is 6.825
and the 325.83 is 325.825. Why is it rounding it up on
the total amt. due but not on the Tax of prod.

When the customer sees the invoice the total looks as
though it is off by 1cent.
 
M

Marshall Barton

bob said:
I have a report- Invoice where I want the decimal places
to be out to 2. I have 1 invoice that is baffling me.
Here goes.

total product $105.00
total freight $214.00
Tax of product
at .065(6.5%) $6.82

Total amt. Due 325.83

when I put them out to 3 decimal places the 6.82 is 6.825
and the 325.83 is 325.825. Why is it rounding it up on
the total amt. due but not on the Tax of prod.

When the customer sees the invoice the total looks as
though it is off by 1cent.


This has nothing to do with Access or the method of
rounding, but is caused by the math you're using. Since you
print the individual values as rounded numbers and then
mentally add them up, there is no guarantee that you'll get
the same answer as when you add the unrounded numbers and
then round the total. In math speak, Round is not a
distributive function, i.e.

Round(X) + Round(Y) <> Round(X + Y)

To get the total to agree with your mental calculation, the
total amt. due must be calculated using the rounded numbers.

=Round(amount) + Round(freight) + Round(tax)

To answer your specific question about one being rounded up
and the other being rounded down, Access uses what's called
Bankers Rounding where the .5 type values are rounded to the
nearest even value (e.g. 2.5 rounds to 2 and 3.5 rounds to
4). In your example above, you need to look at more decimal
places to see that the 325.825 is probably something like
325.8254. This is actually greater than the .5 case so it
will round up. The 6.825 will round down to the 2, which is
even. Make sure that you understand that this is really
irrelevant to getting the mental and calculated results to
agree, so don't worry if you can't follow my inarticulate
explanation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top