Hi All
This is doing my head in!!!
I am using:
if ($country == ‘AU’) { $hasgst = ‘’; $gstamt = $unitprice * .1; $exgst = $unitprice - $gstamt; } else { $hasgst = ‘n’; $exgst = $unitprice; $gstamt = “”; }
$unitprice = (number_format($unitprice, 2, ‘.’, ‘,’));
$exgst = (number_format($exgst, 2, ‘.’, ‘,’));
$gstamt = (number_format($gstamt, 2, ‘.’, ‘,’));
Basically this code works out the GST (tax) of the total amount.
The issue I have is that the current price is $49.95 (this can change to whatever though) and when the code above does its job the number_format option is rounding up putting everything out by .01.
I have read a pile of post I Googled but they are all different.
Can anyone please tell me how to stop the rounding?
Thanks
mrmbarnes