Format Class
Beta
A class used to define the specifications for formatting quantity values. This class is typically loaded by reading FormatProps.
Extends
Methods
Name | Description | |
---|---|---|
constructor(name: string): Format | Constructor | |
clone(options?: CloneOptions): Format | Clone Format | |
fromJSON(unitsProvider: UnitsProvider, jsonObj: FormatProps): Promise<void> | Populates this Format with the values from the provided. | |
toJSON(): FormatProps | Returns a JSON object that contain the specification for this Format. | |
createFromJSON(name: string, unitsProvider: UnitsProvider, formatProps: FormatProps): Promise<Format> Static | Create a Format from FormatProps | |
isFormatTraitSetInProps(formatProps: FormatProps, trait: FormatTraits): boolean Static |
Inherited methods
Name | Inherited from | Description |
---|---|---|
hasFormatTraitSet(formatTrait: FormatTraits): boolean | BaseFormat | This method returns true if the formatTrait is set in this Format object. |
loadFormatProperties(formatProps: FormatProps): void | BaseFormat | |
parseFormatTraits(formatTraitsFromJson: string | string[]): void | BaseFormat | This method parses input string that is typically extracted for persisted JSON data and validates that the string is a valid FormatType. |
Properties
Name | Type | Description | |
---|---|---|---|
_customProps Protected | undefined | any | ||
_units Protected | undefined | [UnitProps, undefined | string][] | ||
customProps Accessor ReadOnly | any | ||
hasUnits Accessor ReadOnly | boolean | ||
units Accessor ReadOnly | undefined | [UnitProps, undefined | string][] |
Inherited properties
Defined in
- quantity/src/Formatter/Format.ts Line 185
Last Updated: 30 November, 2023