create MethodStatic
Static async method to create a ParserSpec given the format and unit of the quantity that will be passed to the Parser. The input unit will be used to generate conversion information for each unit specified in the Format. This method is async due to the fact that the units provider must make async calls to lookup unit definitions.
create(format: Format, unitsProvider: UnitsProvider, outUnit: UnitProps, altUnitLabelsProvider?: AlternateUnitLabelsProvider): Promise<ParserSpec>
Parameter | Type | Description |
---|---|---|
format | Format | The format specification. |
unitsProvider | UnitsProvider | The units provider is used to look up unit definitions and provide conversion information for converting between units. |
outUnit | UnitProps | The unit the value to be formatted. This unit is often referred to as persistence unit. |
altUnitLabelsProvider | AlternateUnitLabelsProvider |
Returns - Promise<ParserSpec>
Defined in
- quantity/src/ParserSpec.ts Line 48
Last Updated: 17 December, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.