Forum Moderators: coopster

Message Too Old, No Replies

This should be simple

php irritations

         

GGR_Web

3:31 pm on Dec 15, 2008 (gmt 0)

10+ Year Member



Hello!
Anyone living in Britian will be aware of our recent tax changes.
Naturally we have been charging the correct rate since the day of the change and displaying the correct prices.

Except in one place in our back end that works differently. This code refers to a db that no-one, absolutely no-one involved seems able to access. Where it is hosted is an ongoing mystery.

<?=pounds_pence($row1['totalprice']+$row1['vat']+$row1['del'])?>

I can't simply change the vat value so I tried this:

<?=pounds_pence($row1['totalprice']+$row1['del']*1.150)?>

where 1.150 is the tax rate. But this produces erratic numbers that I just can't explain, when used on the live site. It's like tax for one order is added or subtracted at random from other orders.

Could someone provide a working example for adding tax so I can at least figure out if I'm doing this or some other weirdness goes on.

[edited by: GGR_Web at 3:33 pm (utc) on Dec. 15, 2008]

andrewsmd

5:43 pm on Dec 15, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this.
<?=pounds_pence({$row1['totalprice']}+{$row1['vat']}+{$row1['del']})?>