Skip to main content

ISymbolValueFormatter

Interface
Types Module: Broker

Specific formatter for number

Methods

format

Default formatter function used to assign the correct sign (+ or -) to a number

Signature

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

Parameters

NameType
pricenumber
options?SymbolValueFormatterFormatOptions

Returns

string

Overrides

INumberFormatter.format


formatChange

Optional

Formatter for a price change

Signature

formatChange(currentPrice: number, prevPrice: number, options?: SymbolValueFormatterFormatOptions) => string

Parameters

NameTypeDescription
currentPricenumbercurrent price
prevPricenumberprevious price
options?SymbolValueFormatterFormatOptionsformat options

Returns

string

Overrides

INumberFormatter.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>