Skip to main content
Version: v27

IPriceFormatter

Interface

Specific formatter for numbers

Methods

format

Price Formatter

Signature

format(price: number, signPositive?: boolean, tailSize?: number, signNegative?: boolean, useRtlFormat?: boolean, cutFractionalByPrecision?: boolean) => string

Parameters

NameTypeDescription
pricenumberprice
signPositive?booleanadd plus sign to result string.
tailSize?numberadd tailSize digits to fractional part of result string
signNegative?booleanadd minus sign to result string.
useRtlFormat?booleanUse Right to left format
cutFractionalByPrecision?booleancuts price by priceScalePrecision, without rounding.

Returns

formatted price

string

Overrides

ISymbolValueFormatter.format


formatChange

Optional

Formatter for a price change

Signature

formatChange(currentPrice: number, prevPrice: number, signPositive?: boolean) => string

Parameters

NameTypeDescription
currentPricenumbercurrent price
prevPricenumberprevious price
signPositive?booleanis the sign of the number positive

Returns

string