sprintf %0.2f : sprintf : Development PHP Source Code


PHP Source Code » Development » sprintf »

 

sprintf %0.2f




<?
$tax = 1.06;
$subtotal = 10.94;
$total = $tax + $subtotal;
$fmt_total = sprintf ("%0.2f", $total);
echo "$fmt_total";
?>
           
       



HTML code for linking to this page:

    PHP Function Reference -> Users Code Examples / Notes - > sprintf:
  • sprintf
  • vsprintf
Follow Navioo On Twitter

PHP Source Code

 Navioo Development
» sprintf