Class CurrencyFormatter
Implements operations for the currecy formatter.
Inheritance
Inherited Members
Namespace: Mediachase.Commerce.Shared
Assembly: Mediachase.Commerce.dll
Version: 12.17.2Syntax
public static class CurrencyFormatter
Properties
Cultures
Gets the cultures.
Declaration
public static CultureInfo[] Cultures { get; }
Property Value
Type | Description |
---|---|
System.Globalization.CultureInfo[] | The cultures. |
Methods
CanBeConverted(Currency, Currency)
Determines whether this instance [can be converted] the specified currency from.
Declaration
public static bool CanBeConverted(Currency currencyFrom, Currency currencyTo)
Parameters
Type | Name | Description |
---|---|---|
Currency | currencyFrom | The currency from. |
Currency | currencyTo | The currency to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
CanBeConverted(Money, Currency)
Determines whether this instance [can be converted] the specified money from.
Declaration
public static bool CanBeConverted(Money moneyFrom, Currency currencyTo)
Parameters
Type | Name | Description |
---|---|---|
Money | moneyFrom | The money from. |
Currency | currencyTo | The currency to. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ConvertCurrency(Money, Currency)
Converts currency from moneyFrom to currencyTo. It will try to find the direct way to convert. If none is found it will try to find reverse way, if that is not available the base currency will be returned.
Declaration
public static Money ConvertCurrency(Money moneyFrom, Currency currencyTo)
Parameters
Type | Name | Description |
---|---|---|
Money | moneyFrom | the amount and currency of money to be converted |
Currency | currencyTo |
Returns
Type | Description |
---|---|
Money | returns converted amount |
Remarks
This function will actually return the effective currency code that was applied.
CurrentCurrency()
Return the three letter ISO currency code for the current thread.
Declaration
public static Currency CurrentCurrency()
Returns
Type | Description |
---|---|
Currency | current currency code in String |