[PHP代码] PHP四舍五入 保留几位小数 格式化数字
2016-03-22 17:15
666 查看
<?php /** 1.number_format */ $number = 1234.56789; $nombre_format_francais = number_format($number, 2, ',', ' '); $english_format_number = number_format($number, 2, '.', ''); http://m.nvzi91.cn/yindaoyan/29371.html /** 2.round */ $number = 1234.56789; echo round($number ,2); http://m.nvzi91.cn/waiyinyan/29372.html /** 3.sprintf */ $formatted = sprintf ("¥%01.2f。", $money); echo $formatted; http://m.nvzi91.cn/liangxingjiankang/201603/22-29373.html ?>m.nvzi91.cn |
相关文章推荐
- [PHP代码] php模拟post发送数据
- [PHP代码] 用php的fsocket模拟get提交 模拟post提交表单
- FPGA静态时序分析——IO口时序(Input Delay /output Delay)(转载)
- 自定义ContentProvider
- 韩顺平老师讲诉如何学习PHP
- 韩顺平老师讲诉如何学习PHP
- php的预定义数组
- 1.1.4 A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (IV)
- 1.1.3 A+B for Input-Output Practice (III)
- Ubuntu Webstorm/PhpStorm创建桌面快捷启动和菜单文字变粗解决
- phpstudy2016最新版本mysql无法使用innodb的问题解决
- php中将数据加入到文件中
- php判断键值在数组中是否存在
- PHP获取多个checkbox的值
- PHP转换SQLite数据库为MySQL
- thinkphp-许愿墙-3
- 数据条数过大时,分片采集
- Zend加密服务器配置以及加密工具的使用
- PHP快速排序