How do I round a number up in PHP?
Question
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.
Solution
You can make use of the ceil($value)
function in PHP to round up.
Similarly you can make use of floor()
for rounding down.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow