Table of Contents

Class CurrencyViewModel

Namespace
Dynamicweb.Ecommerce.Frontend
Assembly
Dynamicweb.Ecommerce.dll

Represents a ViewModelBase for currency information, containing details about a specific currency used within Dynamicweb. This class includes properties for the currency symbol, name, exchange rate, code, and a an indicator for whether it is the default currency.

public class CurrencyViewModel : ViewModelBase
Inheritance
CurrencyViewModel
Inherited Members

Properties

Code

The international standard code that uniquely identifies the currency, such as "USD" for US Dollar, "EUR" for Euro and "DKK" for Danish krone. The code follows the ISO 4217 standard, as such it needs to be a valid value from ISOCurrencySymbol

public string Code { get; set; }

Property Value

string

The ISO 4217 currency code.

Default

Indicates whether this currency is considered the default currency within Dynamicweb. If the value is true, it signifies that this currency is used as the primary currency for transactions or display purposes, if no other currency is specified. This setting defines the main currency the solution should run with.

public bool Default { get; set; }

Property Value

bool

Name

The full name of the currency, giving a descriptive identification compared to the symbol. For example, "US Dollars" for USD, "Euro" for EUR and "Danish krone" if the language used is english, while it could be "Euro", "US" and "Kroner" if the language is danish.

public string Name { get; set; }

Property Value

string

The name of the currency.

Rate

The exchange rate of the currency against the default currency defined. This means, if the Default value is true for the currency, that is now the base exchange rate. The base rate should always be defined as 10000 to allow for 2 decimal precision when converting currencies. If the Default value is false, the rate is defined as the amount of base currency units it takes to buy the base rate in this currency.

Given the scenario where the default currency is DKK with a rate of 10000 and the real-world USD-DKK convertion value is 1:7.477, then; US Dollars rate would be 74770, as you need 74770 DKK to buy 10000 USD.

public double Rate { get; set; }

Property Value

double

The exchange rate of the currency.

Symbol

This property holds the graphical symbol or if it does not have a specific symbol, the abbreviation used to denote the currency, making it easily recognizable. For example, "$" for USD, "€" for EUR or "kr." for DKK.

public string Symbol { get; set; }

Property Value

string

The currency symbol.

To top