CurrencyManager
Class
The CurrencyManager
class is used to manage currency data in Bitrix24. It extends the functionality of AbstractHelper
and provides methods for formatting and retrieving currency information.
TIP
You can test working with CurrencyManager in this example.
Getters
data
ts
get data(): {
currencyBase: string,
currencyList: Map<string, Currency>
}
Returns currency data:
- Base currency code
- List of currencies
Currency
.
baseCurrency
ts
get baseCurrency(): string
Returns the base currency code.
currencyList
ts
get currencyList(): string[]
Returns a list of all currency codes.
Methods
~~### format
ts
format(
value: number,
currencyCode: string,
langCode: string
): string
Formats a value according to currency and language settings.~~
getCurrencyFullName
ts
getCurrencyFullName(
currencyCode: string,
langCode: string
): string
Returns the full name of the currency for the given currency code and language.
getCurrencyLiteral
ts
getCurrencyLiteral(
currencyCode: string,
langCode: string
): string
Returns the string representation of the currency for the given currency code and language.
Data Types
Currency
The Currency
type represents information about a currency.
amount: number
: Amount.amountCnt: number
: Number of units.isBase: boolean
: Flag indicating whether this is the base currency.currencyCode: string
: Currency code.dateUpdate: DateTime
: Date of update.decimals: number
: Number of decimal places.decPoint: string
: Decimal separator.formatString: string
: Format string.fullName: string
: Full name of the currency.lid: string
: Language identifier.sort: number
: Sort order.thousandsSep?: string
: Thousands separator.lang: Record<string, CurrencyFormat>
: Currency formats for different languages.
CurrencyFormat
The CurrencyFormat
type represents the format of a currency.
decimals: number
: Number of decimal places.decPoint: string
: Decimal separator.formatString: string
: Format string.fullName: string
: Full name of the currency.isHideZero: boolean
: Flag indicating whether to hide zeros.thousandsSep?: string
: Thousands separator.thousandsVariant?: 'N'|'D'|'C'|'S'|'B'|'OWN'|string
: Variant of the thousands separator.