Mega Code Archive

 
Categories / Php / Data Type
 

Maintaining the integrity of the data and outputting the end result

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