IPriceFormatter
Interface
Types Module: Broker
Specific formatter for numbers
Methods
format
Price Formatter
Signature
format(price: number, signPositive?: boolean, tailSize?: number, signNegative?: boolean, useRtlFormat?: boolean, cutFractionalByPrecision?: boolean) => string
Parameters
Name | Type | Description |
---|---|---|
price | number | price |
signPositive? | boolean | - |
tailSize? | number | add tailSize digits to fractional part of result string |
signNegative? | boolean | add minus sign to result string. |
useRtlFormat? | boolean | Use Right to left format |
cutFractionalByPrecision? | boolean | cuts price by priceScalePrecision, without rounding. |
Returns
formatted price
string
Overrides
formatChange
OptionalFormatter for a price change
Signature
formatChange(currentPrice: number, prevPrice: number, signPositive?: boolean) => string
Parameters
Name | Type | Description |
---|---|---|
currentPrice | number | current price |
prevPrice | number | previous price |
signPositive? | boolean | is the sign of the number positive |
Returns
string