PHP,格式编号总是有 2 个小数位
问题描述:
在 PHP 中,我有十进制数字,可能有也可能没有尾随零.
In PHP I have decimal numbers that may or may not have trailing zeros.
例如
1
1.1
43.87
我如何确保所有这些数字都恰好有两个小数位,如下所示:
How do I make sure that all these numbers have exactly two decimal places like this:
1.00
1.10
43.87