Home > Backend Development > PHP Tutorial > 求大侠,数字转换钱币。该如何处理

求大侠,数字转换钱币。该如何处理

WBOY
Release: 2016-06-13 10:10:33
Original
978 people have browsed it

求大侠,数字转换钱币。
如何把数字转换成钱币那样子? 
比如 10000 转成 10,000.00

求大侠解决方案。

------解决方案--------------------

探讨

引用:

引用:

引用:

$str='10000';
echo number_format($str,2,'.',',');

10,000.00


如果不定的位数,用str_length 来判断格式化吧?


啥意思.


如果是1000000,1000……
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template