Class CurrencyData
Provides currencies and currency registries loaded from an ICurrencyDataProvider, such as the Unicode Common Locale Data Repository (CLDR)
data provided by the Singulink.Globalization.Currency.Cldr package.
Namespace: Singulink.Globalization
Assembly: Singulink.Globalization.Currency.dll
Syntax
public sealed class CurrencyData
Remarks
Unlike the system registry that Default provides out of the box, registries created from a data provider do not depend on the globalization data of the runtime or operating system, so they behave identically everywhere and can include information that system data lacks, such as cash rounding rules, localized names and symbols for every locale, and currencies that are not the primary currency of any region.
Data is loaded once per data provider instance and cached, so the same Currency instances are returned every time a data provider is loaded. Call SetDefaultProvider(ICurrencyDataProvider, CurrencyTypes) at application startup to make Default return a registry built from a data provider.
Properties
| Name | Description |
|---|---|
| AllCurrencies | Gets all the currencies provided by the data provider, including historical currencies and codes that are not legal tender, ordered by currency code. |
| Provider | Gets the data provider that this data was loaded from. |
| Registry | Gets a registry containing the currencies that are currently legal tender in at least one region. This is equivalent to calling CreateRegistry(CurrencyTypes) with CurrentTender, but the registry is created once and cached. |
Methods
| Name | Description |
|---|---|
| CreateRegistry(CurrencyTypes) | Creates a new registry containing the specified types of currencies. The registry is named after the data provider. |
| GetCurrencyType(Currency) | Gets the type of the specified currency. |
| Load(ICurrencyDataProvider) | Loads currency data from the specified data provider, or returns previously loaded data if the data provider has already been loaded. |