API Reference > imodeljs-frontend > QuantityFormatting > QuantityFormatter > formatQuantity formatQuantity Method Generates a formatted string for a quantity given its format spec. formatQuantity(magnitude: number, formatSpec: undefined | FormatterSpec): string Parameter Type Description magnitude number The magnitude of the quantity. formatSpec undefined | FormatterSpec The format specification. See methods getFormatterSpecByQuantityType and findFormatterSpecByQuantityType. Returns - string the formatted string. Defined in core/frontend/src/quantity-formatting/QuantityFormatter.ts Line 745 Last Updated: 12 June, 2024