开发者

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

开发者 https://www.devze.com 2022-12-14 13:36 出处:网络
So that 335000 开发者_JS百科become 335,000?You can use the number_format function : $number = 335000;

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

精彩评论

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

关注公众号