Skip to main content
Version: latest

IPriceFormatter

Interface

Specific formatter for numbers

Methods

format

Price formatter

Signature

format(price: number, options?: PriceFormatterFormatOptions) => string

Parameters

NameType
pricenumber
options?PriceFormatterFormatOptions

Returns

string

Overrides

ISymbolValueFormatter.format


formatChange

Optional

Price change formatter

Signature

formatChange(price: number, prevPrice: number, options?: PriceFormatterFormatOptions) => string

Parameters

NameType
pricenumber
prevPricenumber
options?PriceFormatterFormatOptions

Returns

string

Overrides

ISymbolValueFormatter.formatChange


parse

Optional

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

Signature

parse(value: string, options?: FormatterParseOptions) => ErrorFormatterParseResult | SuccessFormatterParseResult<number>

Parameters

NameType
valuestring
options?FormatterParseOptions

Returns

ErrorFormatterParseResult | SuccessFormatterParseResult<number>