PHP - number_format() function

0 votes
188 views
added Jul 31, 2018 in PHP by LC Marshal Captain (25,790 points)
<?php
echo number_format("1000000")."<br>";
// output 1,000,000

echo number_format("1000000",2)."<br>";
// 1,000,000.00

echo number_format("1000000",2,",",".");
// 1.000.000,00

?>



 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...