[ic] Easiest way to display price inc VAT/TAX??
jonc at webmaint.com
Sun Sep 5 07:57:41 EDT 2004
> > > All prices are stored in the database ex VAT, what is the
> easiest way to
> > > DISPLAY prices inc VAT? I found a thread referring to this which
> > > mentions "$price /= 1.175" (assumes 17.5%), how do I use that???
> > For retail type catalogs where you tend to display prices inc
> VAT, we tend
> > to set the price in the products table including VAT and display the VAT
> > content on the checkout/receipts.
> > The reason for this is that using a two decimal ex vat price it
> is not to
> > get some inc vat prices to display due to rounding.
> > Alternatively, here is Jamie Neil's solution:
> > Jonathan
> Thanks Jonathan,
> Having read your post after modding the whole site I now have the problem
> across the whole site, typical example:-
> Item in database ex VAT price =3.40
> With 17.5% VAT the price becomes 3.995 so the single price will
> either show
> £3.99 or £4.00, IC rounds up showing £4.00. Of course if you try buying a
> quantity the whole calculation goes wrong because £4.00 x Qty 4 = £16.00
> whereas the subtotal function of IC actually caclulates it
> correctly at 3.995
> * 4 * 1.175 = £15.98
> Having now modded the whole site to display an inc VAT price
> calculated from
> the database ex VAT price (which is what I need), what is the
> best solution?
If you _need_ ex vat prices stored, then how about a custom usertag for the
pricing which works out the price including the vat, rounds it down so it
looks the way you want (eg. 4.997 becomes 4.99) and then back-calculates the
ex vat price which it then returns (to a greater number of decimals). Of
course this is a cludge. A better idea would be to store your ex vat prices
to four decimals.
Webmaint.com - Building Clever Websites http://www.webmaint.com
Webmaint.net - Business Web Hosting http://www.webmaint.net
Cartridge SAVE - Printer Consumables Online
WireTel - Internet Connectivity Solutions http://www.wiretel.net
More information about the interchange-users