November Happy Hour will be moved to Thursday December 5th.

Class CurrencyFormatter

Implements operations for the currecy formatter.

Inheritance
System.Object
CurrencyFormatter
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Mediachase.Commerce.Shared
Assembly: Mediachase.Commerce.dll
Version: 12.17.2
Syntax
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

true if this instance [can be converted] the specified currency from; otherwise, false.

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

true if this instance [can be converted] the specified money from; otherwise, false.

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