Interface: ISymbolValueFormatter
Broker.ISymbolValueFormatter
Specific formatter for number
Hierarchy
-
↳
ISymbolValueFormatter
Methods
format
▸ format(price, options?): string
Default formatter function used to assign the correct sign (+ or -) to a number
Parameters
| Name | Type |
|---|---|
price | number |
options? | SymbolValueFormatterFormatOptions |
Returns
string
Overrides
formatChange
▸ formatChange(currentPrice, prevPrice, options?): string
Formatter for a price change
Parameters
| Name | Type | Description |
|---|---|---|
currentPrice | number | current price |
prevPrice | number | previous price |
options? | SymbolValueFormatterFormatOptions | format options |
Returns
string
Overrides
parse
▸ 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
| Name | Type |
|---|---|
value | string |
options? | FormatterParseOptions |
Returns
ErrorFormatterParseResult | SuccessFormatterParseResult<number>