Skip to main content
Version: latest

INumberFormatter

Interface
Types Module: Broker

Specific formatter for number

Methods

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


formatChange

Optional

Formatter for a price change

Signature

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

Parameters

NameTypeDescription
currentPricenumbercurrent price
prevPricenumberprevious price

Returns

string


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) => ErrorFormatterParseResult | SuccessFormatterParseResult<number>

Parameters

NameType
valuestring

Returns

ErrorFormatterParseResult | SuccessFormatterParseResult<number>