Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$a =99.99999; echo $f = sprintf ("%.2f", $a);
输出值为100.00
100.00
但是我需要99.99
99.99
有人可以帮忙吗
http://3v4l.org/LdHLA
echo intval((99.99999*100))/100;
取自这里:
如何使 number_format() 不四舍五入
使用下面的代码,您将获得所需的代码
echo number_format($a,2);