paul2463 Posted November 26, 2006 Share Posted November 26, 2006 Hello Guysthis is not for any shopping cart system or any rebuilding or other peoples work it started off as a bit of fun as someone asked how it was done and I cannot for the life in me figure out how to do it.[code]to add UK VAT onto a price (presently 17.5%)$unitPrice = 10.50;$totalPrice = round(($unitPrice*1.175), 2);echo $totalprice;[/code]does anyone have the faintest idea how you get it to work out how much was paid in tax if you only had $totalprice to work with?if you take 17.5% off the $totalprice it doesnt work.any help gratefully recieved Quote Link to comment Share on other sites More sharing options...
paul2463 Posted November 26, 2006 Author Share Posted November 26, 2006 isnt it typical, no answers come until you ask the world and then it pops into your head[code]$totalprice = 28.07;$vatAmount = round(($totalprice*0.149),2);$netPrice = $totalprice - $vatAmount;[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.