ceil

Modified on Thu, 9 Jul at 10:49 AM

ceil

TABLE OF CONTENTS

Round up

Definition

int ceil(number $value)

Returns the least integer that is greater or equal to $value.

Parameters

number $value

The value to calculate the ceiling of.

Returns

int

The smallest integer that is greater or equal to $value.

Examples

Sample data
{
  a: ceil(`1.1`),
  b: ceil(`-1.1`),
  c: ceil(`false`),
  d: ceil(`null`),
  e: ceil(`[]`),      // Error
  f: ceil(`{}`),      // Error
  g: ceil(`a`)        // Error
}
Result
{
  "a": 2,
  "b": -1,
  "c": 0,
  "d": 0
}

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article