On 09 April 2004 16:39, Strogg wrote:

[snip original problem for which a fix has been posted]

>   $taxrate = 0.175;  //local tax rate in UK is 17.5%

You should note that UK VAT is always rounded *down*, so that this:

>   $totalamount = $totalamount * (1 + $taxrate);

should be something like:

    $totalamount += round($totalamount*$taxrate-0.00499, 2);

or:

    $totalamount += floor($totalamount*taxrate*100)/100;

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to