API Reference > imodeljs-Quantity > Quantity > FormatterSpec FormatterSpec Class Beta A class that contains both formatting information and the conversion factors necessary to convert from an input unit to the units specified in the format. Once created the FormatterSpec will be able to format quantity values with synchronous calls. Methods Name Description constructor(name: string, format: Format, conversions?: UnitConversionSpec[], persistenceUnit?: UnitProps): FormatterSpec Constructor applyFormatting(magnitude: number): string Format a quantity value. create(name: string, format: Format, unitsProvider: UnitsProvider, inputUnit?: UnitProps): Promise<FormatterSpec> Static Static async method to create a FormatSpec given the format and unit of the quantity that will be passed to the Formatter. getUnitConversions(format: Format, unitsProvider: UnitsProvider, inputUnit?: UnitProps): Promise<UnitConversionSpec[]> Static Get an array of UnitConversionSpecs, one for each unit that is to be shown in the formatted quantity string. Properties Name Type Description _conversions Protected UnitConversionSpec[] _format Protected Format _name Protected string _persistenceUnit Protected UnitProps format Accessor ReadOnly Format name Accessor ReadOnly string persistenceUnit Accessor ReadOnly UnitProps unitConversions Accessor ReadOnly UnitConversionSpec[] Returns an array of UnitConversionSpecs, one for each unit that is to be shown in the formatted quantity string. Defined in quantity/src/Formatter/FormatterSpec.ts Line 20 Last Updated: 12 June, 2024