首页 > Web开发 > 详细

PHP number_format() 函数

时间:2015-04-27 14:55:47      阅读:332      评论:0      收藏:0      [点我收藏+]

定义和用法

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

 技术分享

PHP number_format() 函数

原文:http://www.cnblogs.com/phppoint/p/4459993.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!