Can I make a simple suggestion...
Rather than doing the maths in the order that you have in $x do: $x = 10.7 * 15 * 0.01;
I.e. you're doing the division at the end, rather than the beginning, and so the float is "more accurate".
I'm not sure this will always be true. If you separated it out and put brackets in then maybe you could force it. I'm not sure how PHP would interpret and its order of execution on these.
Ah, good point. That's probably why I don't see this all that often; I normally do things that way around for precisely that reason.
Of course you run the risk of going buffer *overflow* on the left - for very big shopping baskets of course!
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 only other suggestion I would have is why do you have the vat as a fraction (15/100) ? - if its a constant (which it is (bearing in mind iDunno's hardcode comment) wouldnt it be better to have it as 0.15 and :. reducing one calculation by the PHP?
No ones said it yet, so I will. Use a different language!!!
JT