Archive for April, 2009

quick fix | No Comments | April 2nd, 2009

<?php

// Our original decimal number

$number = 21357.44;

// Let’s use PHP’s built-in function to format the number into US currency

$formatted = number_format($number, 2);

// The following statement will print 21,357.44

echo “\$” . $formatted;

?>