Skip to main content

Interface: ISymbolValueFormatter

Broker.ISymbolValueFormatter

Specific formatter for number

Hierarchy​

Methods​

format​

format(price, options?): string

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

Parameters​

NameType
pricenumber
options?SymbolValueFormatterFormatOptions

Returns​

string

Overrides​

INumberFormatter.format


formatChange​

Optional

formatChange(currentPrice, prevPrice, options?): string

Formatter for a price change

Parameters​

NameTypeDescription
currentPricenumbercurrent price
prevPricenumberprevious price
options?SymbolValueFormatterFormatOptionsformat options

Returns​

string

Overrides​

INumberFormatter.formatChange


parse​

Optional

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

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

Parameters​

NameType
valuestring
options?FormatterParseOptions

Returns​

ErrorFormatterParseResult | SuccessFormatterParseResult<number>

Inherited from​

INumberFormatter.parse