Class MoneyCurrencies
- Namespace
- ATAS.DataFeedsCore.Valuation
- Assembly
- ATAS.DataFeedsCore.dll
The catalog of display currencies (PLAT-5080) and the rules that map exchange asset codes to them. The built-in volume indicators format money volumes with Format(decimal, string?, string?, IFormatProvider?) and FormatCompact(decimal, string?, IFormatProvider?).
Not in ATAS 8.0.15 yet: available from the next version.
public static class MoneyCurrencies
- Inheritance
-
objectMoneyCurrencies
Fields
AUD
ISO 4217 code of the Australian dollar.
public const string AUD = "AUD"
Field Value
- string
CAD
ISO 4217 code of the Canadian dollar.
public const string CAD = "CAD"
Field Value
- string
CHF
ISO 4217 code of the Swiss franc.
public const string CHF = "CHF"
Field Value
- string
CNY
ISO 4217 code of the Chinese yuan.
public const string CNY = "CNY"
Field Value
- string
EUR
ISO 4217 code of the euro.
public const string EUR = "EUR"
Field Value
- string
GBP
ISO 4217 code of the pound sterling.
public const string GBP = "GBP"
Field Value
- string
INR
ISO 4217 code of the Indian rupee.
public const string INR = "INR"
Field Value
- string
JPY
ISO 4217 code of the Japanese yen.
public const string JPY = "JPY"
Field Value
- string
RUB
ISO 4217 code of the Russian rouble.
public const string RUB = "RUB"
Field Value
- string
USD
ISO 4217 code of the US dollar.
public const string USD = "USD"
Field Value
- string
Properties
All
Currencies offered to the user, in display order.
public static IReadOnlyList<MoneyCurrencyInfo> All { get; }
Property Value
- IReadOnlyList<MoneyCurrencyInfo>
Methods
Find(string?)
Returns the catalog entry for a display currency code, or null when the code is not a display currency.
public static MoneyCurrencyInfo? Find(string? code)
Parameters
codestring
Returns
Format(decimal, string?, string?, IFormatProvider?)
Formats an amount with the currency symbol. Display currencies get their symbol before or after the amount; any other code (an asset like USDT or BTC) is written after the amount.
public static string Format(decimal amount, string? currency, string? format = null, IFormatProvider? provider = null)
Parameters
amountdecimalThe amount.
currencystringCurrency or asset code.
formatstringNumeric format of the amount; defaults to grouped with the currency's decimals.
providerIFormatProviderFormat provider; defaults to the current culture.
Returns
- string
FormatCompact(decimal, string?, IFormatProvider?)
Formats an amount compactly (K, M, B suffixes) with the currency symbol, e.g. "€13.9K".
public static string FormatCompact(decimal amount, string? currency, IFormatProvider? provider = null)
Parameters
amountdecimalcurrencystringproviderIFormatProvider
Returns
- string
IsSupported(string?)
True when the code is one of the display currencies.
public static bool IsSupported(string? code)
Parameters
codestring
Returns
- bool
IsUsdStablecoin(string?)
True for dollar-pegged stablecoins (USDT, USDC, ...), which are valued as USD.
public static bool IsUsdStablecoin(string? code)
Parameters
codestring
Returns
- bool
ToRateCurrency(string?)
Normalizes an asset or currency code to the currency its value is quoted in for conversions: stablecoins map to USD, anything else is upper-cased as is. Returns null for an empty code.
public static string? ToRateCurrency(string? code)
Parameters
codestring
Returns
- string