Does anyone know the PHP maths query to work out the VAT within a price?
ie. £10. (or $10 for the USA techy bods).
It's not 10 * 15%... because that would find 15% of 10 and add it on.
I need the element within 10 that is the VAT.
Hope someone can help.
Query to work out VAT within a price... how??
Moderator: General Moderators
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Query to work out VAT within a price... how??
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
All the best from the United Kingdom.
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: Query to work out VAT within a price... how??
Gross Price = Net Price * (1 + VAT)
Net Price = 10
VAT = 15%
=> Gross Price = 10 * (1 + 0.15)
=> 11.50
Net Price = Gross Price / (1 + VAT)
Gross Price = 10
VAT = 15%
=> Net Price = 10 / (1 + 0.15)
=> 8.695652174
Net Price = 10
VAT = 15%
=> Gross Price = 10 * (1 + 0.15)
=> 11.50
Net Price = Gross Price / (1 + VAT)
Gross Price = 10
VAT = 15%
=> Net Price = 10 / (1 + 0.15)
=> 8.695652174