floor

Modified on Thu, 9 Jul at 10:49 AM

floor

TABLE OF CONTENTS

Round down

Definition

int floor(number $value)

Returns the greatest integer that is less or equal to $value.

Parameters

number $value

The value to calculate the floor of.

Returns

int

The greatest integer that is less or equal to $value.

Examples

Transformation
{
    a: floor(`1.001`),
    b: floor(`-1.001`),
    c: floor(`1`),
    d: floor(`true`),
    e: floor(`null`)      // Error
}
Result
{
  "a": 1,
  "b": -2,
  "c": 1,
  "d": 1
}

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