Link to home
Start Free TrialLog in
Avatar of AbacusInfoTech
AbacusInfoTech

asked on

Issues with rounding, decimal places on simple invoice form.

Hi,

I have an issue with rounding on a simple invoice form. I want to calculate a sales tax on a line-by-line basis, to two decimal places, and then add up each of these values and pass them to my parent form. My approach so far has been to calculate the tax on individual invoice lines, and I can display them to two decimal places, however the 'SUM' calculation which you have to put in the child form footer (to pass to the parent form) will not actually sum my rounded values, it recalculates on the base data and then rounds itself.

For example (tax rate = 17.5%)

1 X Item 1 @ £15 + Tax gives a tax of £2.63 when rounded.
1 X Item 2 @ £15 + Tax gives a tax of £2.63 when rounded.
1 X Item 3 @ £15 + Tax gives a tax of £2.63 when rounded.

The tax on the invoice should therefore be £7.89 (3 X £2.63)

However, the SUM at the bottom of my child form gives a tax due of £7.88, which is passed to my main form.

Should I use a field for my line tax, and then sum the contents of my field, or should I stick with a calculated control...?
How can I simply pass the correct sum of the line tax on my child form to the parent form?

My 'price each' field is set to currency / 2dp. My calculated controls are too. The display as a currency to 2dp but when you click into a box that reads £2.63 it shows the underlying figure of 2.625.


ASKER CERTIFIED SOLUTION
Avatar of als315
als315
Flag of Russian Federation image

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
Looks strange behavior!
Can you attach a simple database just showing this issue with few records of dummy data?
Avatar of AbacusInfoTech
AbacusInfoTech

ASKER

Hi, thanks for your comments. I'll be looking at this later this week.
.... and three months later I get around to it :-)

Thank you.