如何在php中解析像5.1882449992845E + 25这样的数字

-3 php parsing number-formatting

我正在研究这个会员,计算数字并将它们加起来然后我得到一个数字,如5.1882449992845E + 25我如何强制数字到2位小数,这样我才能有整数.

我想知道任何PHP功能,这与这样的数字和它意味着什么.

Dip*_*mar 5

使用number_format php函数:

number_format(5.211545645612456,2);
Run Code Online (Sandbox Code Playgroud)

有关更多信息,请参阅http://php.net/manual/en/function.number-format.php