submitted by: Snippissimo
PHP: Format Numbers
PHP offers an easy function for displaying formatted numbers. When called with one paramater, the number_format() function returns a string representing the original number with grouped thousands
code snippet:
<?php
// simple number formatting
// http://snippetdb.com/php/
$number = 120938120983;
$formatted = number_format($number);
echo $formatted;
?>
sample output:
120,938,120,983



