You are here: Re: Percentages: Not a php question, but still... « PHP Programming Language « IT news, forums, messages
Re: Percentages: Not a php question, but still...

Posted by Kimmo Laine on 09/01/06 08:16

"universalbitmapper" <jbmorla@gmail.com> wrote in message
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?


Short answer:
100 / (100+VAT) * price with VAT = original price
100 / (100+18) * 118 = 100

I don't know the correct mathematical terms, but basicly this is what
happens:
the ratio of 100 : (100 + VAT) must be the same ratio as "original price" :
"VAT price"
100 / (100 + VAT) = original price / VAT price
multiply both sides with VAT price:

==> 100 / (100 + VAT) * VAT price = original price * (VAT price/VAT price)
==> 100 / (100 + VAT) * VAT price = original price

there you have it.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация