Mega Code Archive

 
Categories / Php / Strings
 

Integral that the value be displayed as a dollar amount set to two decimal places

<?php   $thenumber = 9.99 * 1.07;   echo "$" . $thenumber . "<br />";    echo "$" . sprintf ("%.2f", $thenumber);  ?>