Floor

Not available in this language yet.
Floor( value )
Floor( value )
Floor( value )
Not available in this language yet.
Floor( value )

Description

The Floor function returns the largest value that is less than or equal to the argument and is equal to a mathematical integer.

Parameters

Argument Type Definition and Requirements

value

Number

Take the floor of this value.

Returns

A number which is the result of the Floor operation.

Examples

The query below executes an array of independent floor operations and returns the results in an array. The result array position matches the execution array position. The top operation in the execution array, floor of 7.0, returns a long value of 7 in the top position of the result array.

Not available in this language yet.
Not available in this language yet.
System.out.println(
    client.query(
        Arr(
            Floor(Value(7.0)),
            Floor(Value(1.11)),
            Floor(Value(2.99))
        )
    ).get());
[7.0, 1.0, 2.0]
client.query([
  q.Floor(7.0),
  q.Floor(1.11),
  q.Floor(2.99),
])
.then((ret) => console.log(ret))
[ 7, 1, 2 ]
Not available in this language yet.
println(Await.result(
  client.query(
    Arr(
      Floor(7.0),
      Floor(1.11),
      Floor(2.99)
    )
  ),
  5.seconds
))
[7.0, 1.0, 2.0]

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!