Round的结果格式

-1 php

可能重复:
如何在php中以某种格式显示数字

echo round(10.1232, 2); // return 10.12
Run Code Online (Sandbox Code Playgroud)

这工作正常,但是:

echo round(10, 2); // return 10
Run Code Online (Sandbox Code Playgroud)

我想收到10.00.我该怎么做?

And*_*ewR 5

使用number_format()

echo number_format(10, 2, '.', '');
Run Code Online (Sandbox Code Playgroud)