Hi,
I'm currently working with PHP and a mySQL database. At the moment, i'm pulling out numbers from the database in the region of 20-30 million.. ie:
20293827
Does anyone know of any way to put commas inside the number to make it clearer to read?
ie.
20,293,827
I bet there's a simple solution out there, but I'm at a loss at the moment!
Thanks,
Jonathan
try a number_format()
for the exact syntax look at http://www.php.net/manual/function.number-format.php
Torty
$unformatednum = "4832722";
$hits = number_format($unformatednum, ",");
$hits will be your formated number with commas. (4,832,722)