7

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.

1

1 Answer 1

11

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

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

1
  • Similarly use floor() for rounding down regardless. Ceil == ceiling btw.
    – Ross
    Nov 2, 2008 at 16:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy