PHP 中把 float 转换成字符串

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/henryhu712/article/details/83833528

方法:

number_format($float, 2, '.', '');

上面的结果输出带2位小数的字符串。如果只要整数部分,就将2改成0。

猜你喜欢

转载自blog.csdn.net/henryhu712/article/details/83833528