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
Name | Type | Default value | Description |
---|---|---|---|
imperialUnit | Unit <any > | undefined | The type of the imperial unit. |
metricUnit | Unit <any > | undefined | The type of the metric unit. |
options | Partial <ConvertableNumberAndUnitFormatOptions > | {} | Format options. |
nullValueString | string | '' | null value string. |
conditionalStyle | (value : number ) => string | undefined | A 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
Name | Type |
---|---|
value | number |
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
Name | Type |
---|---|
value | number |
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
Name | Type |
---|---|
input | string |
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