number_format() (PHP) - number_format-Формирует число со сгруппированными тысячами
<!DOCTYPE html>
<html>
<body>
<?php
echo number_format("1000000")."<br>";
echo number_format("1000000",2)."<br>";
echo number_format("1000000",2,",",".");
?>
</body>
</html>
echo:
1,000,000
1,000,000.00
1.000.000,00
1
2