create MethodStatic
Static async method to create a FormatSpec given the format and unit of the quantity that will be passed to the Formatter. 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(name: string, format: Format, unitsProvider: UnitsProvider, inputUnit?: UnitProps): Promise<FormatterSpec>
Parameter | Type | Description |
---|---|---|
name | string | The name of a format specification. |
format | Format | |
unitsProvider | UnitsProvider | The units provider is used to look up unit definitions and provide conversion information for converting between units. |
inputUnit | UnitProps | The unit the value to be formatted. This unit is often referred to as persistence unit. |
Returns - Promise<FormatterSpec>
Defined in
Last Updated: 20 June, 2023