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}
1.58700.precision() // 5
{:.stu}
For Date and DateTime values, the function returns the number of digits of precision in the input value. {:.stu}
@2014.precision() // 4
@2014-01-05T10:30:00.000.precision() // 17
@T10:30.precision() // 4
@T10:30:00.000.precision() // 9
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
Type Mapping
Example
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