- Below code can use for that
<?php
echo number_format("1000000")."<br>";
echo number_format("1000000",2)."<br>";
echo number_format("1000000",2,",",".");
?>
Outputs will be
1,000,000
1,000,000.00
1.000.000,00
Syntax
number_format(number,decimals,decimalpoint,separator)
One Reply to “How to use PHP number_format() function”