zor*_*oro 0 php
例如: (a)123 /(b)1000 =(c)0,123 echo c必须为0,12 如何做到这一点?
Dan*_*erg 6
使用round(),sprintf()或number_format().
round()
sprintf()
number_format()
例子:
<?php $res = 123/1000; printf('%.2f', $res); echo round($res, 2); echo number_format($res, 2); ?>
归档时间:
15 年,7 月 前
查看次数:
87 次
最近记录: