der*_*ert 7 php number-formatting
我怎样才能sprintf像我一样格式化浮点数number_format()?我需要
随着number_format()我会这样做
$number = number_format(1599, 0, ".", ",");
Run Code Online (Sandbox Code Playgroud)
结果应该是:
1599 => 1.500
899.99 => 899
70 => 70
Run Code Online (Sandbox Code Playgroud)
这可能用sprintf()吗?
亲切的问候,罗伯特
dec*_*eze 10
sprintf('A number: %s', number_format(1599, 0, '.', ','))
Run Code Online (Sandbox Code Playgroud)
不,没有其他办法.(s)printf没有添加千位分隔符的选项.
| 归档时间: |
|
| 查看次数: |
7646 次 |
| 最近记录: |