Round the number with number_format in PHP
Description
The following code shows how to round the number with number_format.
Example
// w w w .ja v a2 s.co m
<?php
$num = 1999.9;
$formattedNum = number_format($num)."<br>";
echo $formattedNum;
$formattedNum = number_format($num, 2);
echo $formattedNum;
?>
The code above generates the following result.