Home » Php » rounding – How do I round a number up in PHP?

rounding – How do I round a number up in PHP?

Posted by: admin July 12, 2020 Leave a comment

Questions:

I need to round any non-integers up to the nearest integer, regardless of whether the number after the decimal place is >5 or not.

How to&Answers:

You can make use of the ceil($value) function in PHP to round up.

Similarly you can make use of floor() for rounding down.