Skip to main content
Version: v24

Interface: INumberFormatter

Charting Library.INumberFormatter

Specific formatter for number

Hierarchy

Methods

PropertyType
format(value?: number) => string
parse?(value: string) => ErrorFormatterParseResult | SuccessFormatterParseResult<number>
formatChange?(currentPrice: number, prevPrice: number) => string

format

Whatever the input type, formats the data following a certain logic and return that value as a string

Signature

format(value?: number) => string

Parameters

NameType
value?number

Returns

string

Inherited from

IFormatter.format


parse

Check if the input value satisfies the logic and return either an error or the result of the parsing

Signature

Optional parse(value: string) => ErrorFormatterParseResult | SuccessFormatterParseResult<number>

Parameters

NameType
valuestring

Returns

ErrorFormatterParseResult | SuccessFormatterParseResult<number>

Inherited from

IFormatter.parse


formatChange

Signature

Optional formatChange(currentPrice: number, prevPrice: number) => string

Parameters

NameType
currentPricenumber
prevPricenumber

Returns

string