--- type: "fhirpath-function" title: "FHIRPath Function: floor" function: "floor" category: "Math" section: "5.8.4" source: "fhirpath/functions.json" --- # FHIRPath Function: floor {:.stu} Returns the first integer less than or equal to the input. {:.stu} Accepts input types of Decimal or Quantity. {:.stu} When used with a Decimal input type, the result is an Integer.
When used with a Quantity, the result is a Quantity with the same units and the value *(Decimal)* set to the integer result calculated. {:.stu} If the input collection is empty, the result is empty. {:.stu} If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment. {:.stu} ``` fhirpath 1.floor() // 1 2.1.floor() // 2 (-2.1).floor() // -3 ``` {:.stu} > Note: We may consider a FloorLong() function to handle Long output types. {: .stu-note } ## Summary - **Category**: Math - **Section**: `5.8.4` - **Return Type**: `Integer | Quantity` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description Returns the first integer less than or equal to the input. ## Arguments - none ## Type Mapping - `Integer-Integer` - `Decimal-Integer` - `Quantity-Quantity` ## Example ```fhirpath 1.floor() // 1 2.1.floor() // 2 (-2.1).floor() // -3 ```