Skip to main content

Class: ConvertableNumberAndUnitFormat

Format for number with unit entries that is convertable based on the sim's unit system.

Implements

  • Validator<number>
  • Formatter<number>

Constructors

constructor

new ConvertableNumberAndUnitFormat(imperialUnit, metricUnit, options?, nullValueString?, conditionalStyle?): ConvertableNumberAndUnitFormat

CTOR

Parameters

NameTypeDefault valueDescription
imperialUnitUnit<any>undefinedThe type of the imperial unit.
metricUnitUnit<any>undefinedThe type of the metric unit.
optionsPartial<ConvertableNumberAndUnitFormatOptions>{}Format options.
nullValueStringstring''null value string.
conditionalStyle(value: number) => stringundefinedA function that can return a style string.

Returns

ConvertableNumberAndUnitFormat

Defined in

workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:357

Properties

conditionalStyle

Protected Readonly conditionalStyle: (value: number) => string

A function that can return a style string.

Type declaration

▸ (value): string

A function that can return a style string.

Parameters
NameType
valuenumber
Returns

string

Defined in

workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:361


imperialUnit

Protected Readonly imperialUnit: Unit<any>

The type of the imperial unit.

Defined in

workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:358


metricUnit

Protected Readonly metricUnit: Unit<any>

The type of the metric unit.

Defined in

workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:358


nullValueString

Readonly nullValueString: string = ''

null value string.

Implementation of

Formatter.nullValueString

Defined in

workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:360


options

Protected Readonly options: ConvertableNumberAndUnitFormatOptions

Defined in

workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:347

Methods

format

format(value): string

Parameters

NameType
valuenumber

Returns

string

Inherit Doc

Implementation of

Formatter.format

Defined in

workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:399


parse

parse(input): null | number

Parameters

NameType
inputstring

Returns

null | number

Inherit Doc

Implementation of

Validator.parse

Defined in

workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:379