registerFieldFormatting MethodStatic @beta
Configures how "quantity" and "coordinate" FieldRuns in args.iModel are
formatted by evaluateFields and by TxnManager field-update callbacks.
Calling this is optional. An iModel with no registration formats every field using the presentation format its schema declares for the KindOfQuantity, in the metric unit system. Register to layer application FormatSets over those schema defaults, or to select a different unit system. Formats resolve in this order:
- The FormatSet named by the field's QuantityFieldFormatOptions.formatSet.
- The FormatSet adopted for the iModel (formatSet).
- The KindOfQuantity's presentation format for unitSystem.
value.toString(), with a warning logged.
Units resolve through the bundled BIS BasicUnitsProvider only. A field whose persistence unit, or whose format's units, are defined solely by the iModel's own schemas falls to step 4.
Pass the iModel-wide default as formatSet and any per-field alternatives as formatSets,
keyed by the id that FieldRuns name via
QuantityFieldFormatOptions.formatSet:
Each call replaces any prior registration for the same iModel; calling it with only
iModel reverts to the schema defaults. Registering does not re-evaluate existing
annotations; listen to onFieldFormattingChanged to do so. The registration lives as long
as the IModelDb object and is released with it.
registerFieldFormatting(args: FieldFormattingArgs): void
@see Quantity formatting for text annotation fields
| Parameter | Type | Description |
|---|---|---|
| args | FieldFormattingArgs |
Returns - void
Defined in
Last Updated: 02 October, 2026