Format Class

Beta  

Extends

Methods

Name Description
constructor(schema: Schema, name: string): Format    
addUnit(unit: Unit | InvertedUnit, label?: string): void Protected Adds a Unit, or InvertedUnit, with an optional label override.  
fromJSON(formatProps: FormatProps): Promise<void>    
fromJSONSync(formatProps: FormatProps): void    
hasFormatTrait(formatTrait: FormatTraits): boolean    
setPrecision(precision: number): void Protected    
toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): FormatProps Save this Format's properties to an object for serializing to JSON.  

Inherited methods

Name Inherited from Description
equalByKey(thisSchemaItem: SchemaItem, thatSchemaItemOrKey?: SchemaItem | SchemaItemKey): boolean Static SchemaItem Indicates if the two SchemaItem objects are equal by comparing their respective SchemaItem.key properties.
parseFullName(fullName: string): [string, string] Static SchemaItem Parses the given full name, {schemaName}.{schemaItemName} or {schemaName}:{schemaItemName}, into two separate strings.

Properties

Name Type Description
_decimalSeparator Protected string    
_formatTraits Protected FormatTraits    
_includeZero Protected boolean    
_minWidth Protected undefined | number    
_precision Protected number    
_roundFactor Protected number    
_scientificType Protected undefined | ScientificType    
_showSignOption Protected ShowSignOption    
_spacer Protected string    
_stationOffsetSize Protected undefined | number    
_stationSeparator Protected string    
_thousandSeparator Protected string    
_type Protected FormatType    
_units Protected undefined | [Unit | InvertedUnit, undefined | string][]    
_uomSeparator Protected string    
decimalSeparator Accessor ReadOnly string    
formatTraits Accessor ReadOnly FormatTraits    
includeZero Accessor ReadOnly undefined | boolean    
minWidth Accessor ReadOnly undefined | number    
precision Accessor ReadOnly DecimalPrecision | FractionalPrecision    
roundFactor Accessor ReadOnly number    
schemaItemType Readonly Format    
scientificType Accessor ReadOnly undefined | ScientificType    
showSignOption Accessor ReadOnly ShowSignOption    
spacer Accessor ReadOnly undefined | string    
stationOffsetSize Accessor ReadOnly undefined | number    
stationSeparator Accessor ReadOnly string    
thousandSeparator Accessor ReadOnly string    
type Accessor ReadOnly FormatType    
units Accessor ReadOnly undefined | [Unit | InvertedUnit, undefined | string][]    
uomSeparator Accessor ReadOnly string    

Inherited properties

Name Type Inherited from Description
_description Protected undefined | string SchemaItem  
_key Protected SchemaItemKey SchemaItem  
_label Protected undefined | string SchemaItem  
description Accessor ReadOnly undefined | string SchemaItem  
fullName Accessor ReadOnly string SchemaItem  
key Accessor ReadOnly SchemaItemKey SchemaItem  
label Accessor ReadOnly undefined | string SchemaItem  
name Accessor ReadOnly string SchemaItem  
schema Readonly Schema SchemaItem  

Defined in

Last Updated: 12 June, 2024