码迷,mamicode.com
首页 > Web开发 > 详细

PHP number_format() 函数

时间:2015-04-27 14:57:20      阅读:211      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!