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
Name | Type |
---|---|
price | number |
options? | SymbolValueFormatterFormatOptions |
Returns
string
Overrides
formatChange
OptionalFormatter for a price change
Signature
formatChange(currentPrice: number, prevPrice: number, options?: SymbolValueFormatterFormatOptions) => string
Parameters
Name | Type | Description |
---|---|---|
currentPrice | number | current price |
prevPrice | number | previous price |
options? | SymbolValueFormatterFormatOptions | format options |
Returns
string
Overrides
parse
OptionalCheck 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
Name | Type |
---|---|
value | string |
options? | FormatterParseOptions |
Returns
ErrorFormatterParseResult | SuccessFormatterParseResult<number>