Posted by Petr Vileta on 09/01/06 12:54
"universalbitmapper" <jbmorla@gmail.com> wrote in
news:1157093880.725466.161370@h48g2000cwc.googlegroups.com...
> Hi,
>
> I'm coding a PHP/MySQL application.
> I'm looking for the formula to compute the original variable after it
> has been applied VAT.
> For instance 100 + 18% -> 118.
> But if I try to find out 100 from 118 - 18%, the result is greater than
> 100.
> I don't have enough maths background to solve the equation:
> c = a + (a*b/100)
> I'm stuck at this point:
> a = (a*b/100) -c
> I would like to have all 'a' on the left side and b and c on the right.
>
> Can someone help?
>
price_without_wat = price_incl_vat / (100 + vat) * 100
In your example: 100 = 118 / (100 + 18) * 100
--
Petr Vileta, Czech republic
(My server rejects all messages from Yahoo and Hotmail. Send me your mail
from another non-spammer site please.)
[Back to original message]
|