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

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

WBOY
WBOYOriginal
2016-06-13 13:40:211035browse

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

求大侠解决方案。

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

探讨

引用:

引用:

引用:

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

10,000.00


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


啥意思.


如果是1000000,1000……
Statement:
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