开发者

How to automatically add ',' to numbers in PHP?

So that 335000 开发者_JS百科become 335,000?


You can use the number_format function :

$number = 335000;
echo number_format($number);

Will get you :

335,000


And, if necessary, you can use the additionnal parameters (see the manual page) to use a different number of digits, another decimal separator, ...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜