FormatSpecHandle Class @beta
A cacheable handle to formatting and parsing specs for a specific KoQ and persistence unit. Automatically refreshes when the QuantityFormatter reloads. Use QuantityFormatter.getFormatSpecHandle to create instances.
When formatting is not yet ready, format returns a value.toString() fallback.
Call dispose when the handle is no longer needed to unsubscribe from reload events.
Implements
- Disposable
Methods
| Name | Description | |
|---|---|---|
| [dispose](): void | Unsubscribe from reload events and clear cached specs. | |
| format(value: number): string | Format a quantity value using the current spec. |
Properties
| Name | Type | Description | |
|---|---|---|---|
| formatterSpec Accessor ReadOnly | undefined | FormatterSpec | The current FormatterSpec, or undefined if not yet loaded. | |
| koqName Accessor ReadOnly | string | The KoQ name this handle is keyed to. | |
| parserSpec Accessor ReadOnly | undefined | ParserSpec | The current ParserSpec, or undefined if not yet loaded. | |
| persistenceUnit Accessor ReadOnly | string | The persistence unit this handle is keyed to. | |
| system Accessor ReadOnly | undefined | UnitSystemKey | The unit system this handle is pinned to, or undefined for the active system. |
Defined in
- quantity/src/FormatSpecHandle.ts Line 32
Last Updated: 18 April, 2026
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.