dsfsdfsd34324 2019-07-16 17:40
浏览 59
已采纳

如何在PHP中将数字从621编译到700?

$num=621;
echo round(round(621,-2));
  • 写回答

4条回答 默认 最新

  • duangai1368 2019-07-16 21:15
    关注

    I think you are trying to round off a number to the nearest 100. Simply do this by using the ceil function.

    ceil(621 / 100) * 100;
    

    You can use ceil function to round any number to its nearest number.

    $number = ceil($inputNumber / $nearestNumber) * $nearestNumber;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?