PHP number_format
<?php
$str = 123465789;
echo number_format($str).'<br>';//output 123,465,789
echo number_format($str, 2);//output 123,465,789.00
?>
<?php
$str = 123465789;
echo number_format($str).'<br>';//output 123,465,789
echo number_format($str, 2);//output 123,465,789.00
?>