R
Ronald Roberts
I have an application that needs to calculate an answer
in whole dollars. There are 2 values and sales tax used
in the calculation. The first value is course fee, which
is non-taxable. The second value is text fee and is taxable.
The problem:
A user will enter a new record. In this record they will
enter the course fee and the text fee. If the user checks
the tax status as taxable, the program will calculate the
sales tax. If the total cost is not in whole dollars, the
program will adjust the text fee up to 5 times until the
total cost is a whole dollar amount. About 95% of the time,
the program will find a whole dollar answer. What I’m looking
for is a calculation that will find a whole dollar answer 100%
of the time and stay within a reasonable range of the original
text fee, say plus or minus 5-10 cents.
The program cannot just drop the cents of the text fee or the
sales tax answer for 2 Reasons.
1) The correct taxes must be paid based on the text fee amount.
2) Rounding the text fee to whole dollars may still result in a
sales tax amount that Is not in whole dollars.
Any help is greatly appreciated
Ron
in whole dollars. There are 2 values and sales tax used
in the calculation. The first value is course fee, which
is non-taxable. The second value is text fee and is taxable.
The problem:
A user will enter a new record. In this record they will
enter the course fee and the text fee. If the user checks
the tax status as taxable, the program will calculate the
sales tax. If the total cost is not in whole dollars, the
program will adjust the text fee up to 5 times until the
total cost is a whole dollar amount. About 95% of the time,
the program will find a whole dollar answer. What I’m looking
for is a calculation that will find a whole dollar answer 100%
of the time and stay within a reasonable range of the original
text fee, say plus or minus 5-10 cents.
The program cannot just drop the cents of the text fee or the
sales tax answer for 2 Reasons.
1) The correct taxes must be paid based on the text fee amount.
2) Rounding the text fee to whole dollars may still result in a
sales tax amount that Is not in whole dollars.
Any help is greatly appreciated
Ron