In PHP how do you format a number as currency handling cases such as 10 cents equaling "$.1";
- by stormist
I currently do:
$totalBill = number_format($totalBill, 2);
$totalBill = '$'.$totalBill;
This does not handle cases though where the total is say 10 cents. It returns "$0.1" which I do not want. Does anyone have a better way?