Class: ConvertableNumberAndUnitFormat
Defined in: workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:346
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
Defined in: workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:357
CTOR
Parameters
Parameter | 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 ) => string | ... | A function that can return a style string. |
Returns
ConvertableNumberAndUnitFormat
Properties
conditionalStyle()
protected
readonly
conditionalStyle: (value
) =>string
Defined in: workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:361
A function that can return a style string.
Parameters
Parameter | Type |
---|---|
value | number |
Returns
string
imperialUnit
protected
readonly
imperialUnit:Unit
<any
>
Defined in: workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:358
The type of the imperial unit.
metricUnit
protected
readonly
metricUnit:Unit
<any
>
Defined in: workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:358
The type of the metric unit.
nullValueString
readonly
nullValueString:string
=''
Defined in: workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:360
null value string.
Implementation of
Formatter.nullValueString
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
Defined in: workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:399
Parameters
Parameter | Type |
---|---|
value | number |
Returns
string
Inherit Doc
Implementation of
Formatter.format
parse()
parse(
input
):null
|number
Defined in: workingtitle-instruments-wt21/instruments/html_ui/Pages/VCockpit/Instruments/WT21/FMC/Framework/FmcFormats.ts:379
Parameters
Parameter | Type |
---|---|
input | string |
Returns
null
| number
Inherit Doc
Implementation of
Validator.parse