On the PHP Manualnumber_format page at :
string number_format (float $ number, int $ decimals = 0, string $ dec_point = '.', string $ thousand_sep = ',')
If you want type numbers to be 123456formatted as 1234,45, use:
echo number_format($number / 100, 2, ",", "");
If you need a dot as a thousands separator ( 1.234,56):
echo number_format($number / 100, 2, ",", ".");
PHP automatically removes zeros when converting a string to a number.
source
share