I need to format float output from my database. I have to pull out a float, multiply it by a quantity number, then have it display as a currency. How do I get PHP to display 12 as 12.00 or 13.1332 as 13.13, limiting it to 2 decimal places?
number_format($num,2)
Thanks, I just found an answer, slightly different than yours but it works:
<? printf('%01.2f', ($FrmPrice * $FrmQty)); ?>
moonie 😉