Skip to main content

core.formatquantity

Home > @medplum/core > formatQuantity

formatQuantity() function

Returns a human-readable string for a FHIR Quantity datatype, taking into account units and comparators

Signature:

export declare function formatQuantity(quantity: Quantity | undefined, precision?: number): string;

Parameters

ParameterTypeDescription
quantityQuantity | undefinedA FHIR Quantity element
precisionnumber(Optional) Number of decimal places to display in the rendered quantity values

Returns:

string

A human-readable string representation of the Quantity