Brett Parker wrote:
Well, how about giving a range that we can play in, and then I can tell you ;)
Well the site will sell products from a few pence up to a few hundred pounds, and people buy between one and several hundred items at a time. VAT is obviously within a fairly narrow range (15-17.5%).
Of course, I'm assuming that you're actually pulling these from a database engine, so you could just get that to do the maths... you shouldn't *ever* hardcode VAT rate (as Jenny found out with her invoicing system ;)
The problem I have is that I'm trying to fix one problem in a large system so I don't get to re-make initial design decisions like these, and no, at present these are not coming directly from a database. VAT is not hardcoded, and the system doesn't even assume that the number of decimal places is always going to be 2 (which is part of the problem - if it were always 2 then making a design decision to doing everything in pence/cents would probably have been made by the original developers).
The cart I'm working with (ZenCart) has some very weird and wonderful ideas when it comes to calculating the total of a shopping cart (particularly when discounts come into play). I'd dearly like to be in a position to rewrite it!