$short_pi = "3.14159";
$my_pi = number_format($short_pi, 2);
echo $my_pi."\n"; // 3.14
PHP里设置小数点的位数
最新推荐文章于 2022-08-22 17:29:26 发布
$short_pi = "3.14159";
$my_pi = number_format($short_pi, 2);
echo $my_pi."\n"; // 3.14