Need a formula for calculating the tax portion of a total amount.

Posted by pawz on Stack Overflow See other posts from Stack Overflow or by pawz
Published on 2010-04-11T10:21:00Z Indexed on 2010/04/11 10:23 UTC
Read the original article Hit count: 327

Filed under:
|

In Australia we have to advertise products with tax already added, so rather than say a product is $10 + $1 GST = $11, we normally work backwards and say "ok, total is $10, how much of that is GST ?"

For example, for a $10 total, you do 10 * (1 /11) = 0.91, which is the tax component of the $10 total. My problem is I need calculate a formula for working out the taxable component when the tax rate is a variable. So far I've made this calculation although I'm not sure how correct an assertion it is:

10 * (1 / x) = 0.09 * (1 / y)

where y = 10, x = 11

Basically i want to work out x on the left hand side when I know that the tax rate is 0.05 for example, which will give me a formula that I can use to calculate the taxable component of an total figure. I want a function into which I can plug in the total price and the tax rate, and get back the taxable component of the total price.

I'd really appreciate the help with this as it really makes my head hurt ! :")

© Stack Overflow or respective owner

Related posts about math

Related posts about tax