--- type: "fhirpath-function" title: "FHIRPath Function: precision" function: "precision" category: "Utility functions" section: "5.10.7" source: "fhirpath/functions.json" --- # FHIRPath Function: precision {:.stu} If the input collection contains a single item, this function will return the number of digits of precision. {:.stu} The function can only be used with Decimal, Date, DateTime, and Time values. {:.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} For Decimal values, the function returns the number of digits of precision after the decimal place in the input value. {:.stu} ``` fhirpath 1.58700.precision() // 5 ``` {:.stu} For Date and DateTime values, the function returns the number of digits of precision in the input value. {:.stu} ``` fhirpath @2014.precision() // 4 @2014-01-05T10:30:00.000.precision() // 17 @T10:30.precision() // 4 @T10:30:00.000.precision() // 9 ``` {:.stu} ## Summary - **Category**: Utility functions - **Section**: `5.10.7` - **Return Type**: `Integer` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description If the input collection contains a single item, this function will return the number of digits of precision. The function can only be used with Decimal, Date, DateTime, and Time values. ## Arguments - none ## Type Mapping - `Decimal-Integer` - `Date-Integer` - `DateTime-Integer` - `Time-Integer` ## Example ```fhirpath 1.58700.precision() // 5 @2014.precision() // 4 @2014-01-05T10:30:00.000.precision() // 17 @T10:30.precision() // 4 @T10:30:00.000.precision() // 9 ```