定义和用法
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
时间: 2024-10-20 00:42:29