INumberFormatter
Interface
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, options?: FormatterFormatOptions) => string
Parameters
Name | Type |
---|---|
value? | number |
options? | FormatterFormatOptions |
Returns
string
formatChange
OptionalFormatter for a price change
Signature
formatChange(currentPrice: number, prevPrice: number, options?: FormatterFormatOptions) => string
Parameters
Name | Type | Description |
---|---|---|
currentPrice | number | current price |
prevPrice | number | previous price |
options? | FormatterFormatOptions | format options |
Returns
string
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>