Skip to main content

core.formatrange

Home > @medplum/core > formatRange

formatRange() function

Returns a human-readable string for a FHIR Range datatype, taking into account one-sided ranges

Signature:

export declare function formatRange(range: Range | undefined, precision?: number, exclusive?: boolean): string;

Parameters

ParameterTypeDescription
rangeRange | undefinedA FHIR Range element
precisionnumber(Optional) Number of decimal places to display in the rendered quantity values
exclusiveboolean(Optional) If true, one-sided ranges will be rendered with the > or < bounds rather than >= or <=

Returns:

string

A human-readable string representation of the Range