The number_format() function return the readable number. it takes one, two or four parameters and doesn't take three parameters. This function gives you an easy way to format numbers for displaying to the user.

The number parameter is an only allow numeric value and it will be formatted without a decimal point and with comma (,) as the thousands separator.

The decimals parameter is an optional value. how many numbers after show decimal point.

The decimal point parameter is an optional value. it is specified which symbols use.

The separator parameter is an optional value. it is specified the thousands separator.



See below Example


echo number_format($number).'<br>';
echo number_format($number, 2).'<br>';
echo number_format($number, 3).'<br>';
echo number_format($number, 2, ',', '.');