Oihana PHP Arango

floor.php

Table of Contents

Functions

floor()  : string
Return the integer closest but not greater than the given value.

Functions

floor()

Return the integer closest but not greater than the given value.

floor(string|int|float $value) : string

This helper wraps the ArangoDB AQL function FLOOR(value) which rounds down a number to the nearest integer that is less than or equal to the value.

Example AQL usage:

FLOOR(4.1)                    // returns 4
FLOOR(4.9)                    // returns 4
FLOOR(-4.1)                   // returns -5
FLOOR(doc.price)              // rounds down the price
Parameters
$value : string|int|float

Any number to round down.

Tags
example
use function oihana\arango\db\functions\numerics\floor;

$expr = floor(4.9);
// Produces: 'FLOOR(4.9)'
see
https://docs.arangodb.com/stable/aql/functions/numeric/#floor
ceil()

For rounding up.

round()

For rounding to nearest.

since
1.0.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results