PHP数字金额保留两位小数

可以使用sprintf()

sprintf("%1\$.2f",$money);

例如

0.01=》0.01

0.1=》0.10

1 =》1.00

1.011=》1.01

1.015=》1.01

猜你喜欢

转载自blog.csdn.net/qq_24138677/article/details/131458708
今日推荐