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.
我是 php 的初学者。当我尝试将整数值与小数相乘时,得到如下结果。
1.00 * 5 = 0 。我希望输出为 5.00 如何使用 php 完成?
我想你正在寻找number_format:
number_format
number_format(1.00 * 5, 2); // "5.00"
在此处查看实际操作:http ://codepad.viper-7.com/mSFpqH