number_format() 函数通过千位分组来格式化数字。
1 number_format(number,decimals,decimalpoint,separator)
1 <?php 2 echo number_format("1000000"); 3 echo number_format("1000000",2); 4 echo number_format("1000000",2,",","."); 5 ?>
输出:
1 1,000,000 2 1,000,000.00 3 1.000.000,00
原文:http://www.cnblogs.com/phppoint/p/4459993.html