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.
希望将字节转换为四舍五入的最接近的 MB。
所以..
605768 would become 1 not 0.577705 1704342 would become 2 not 1.625387192
ETC
我该怎么做呢 ?我只想要返回的值。
谢谢
如果你使用round函数,你可以收到预期的结果。例如
round
echo round((605768/(1024 * 1024)));将产生 1。
echo round((605768/(1024 * 1024)));
使用圆形功能
echo round(0.57705);
这意味着像
参考这个