Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

ExchangeRate.cs

namespace Nop.Core.Domain.Directory;

/// 
/// Represents an exchange rate
/// 
public partial class ExchangeRate
{
    /// 
    /// Creates a new instance of the ExchangeRate class
    /// 
    public ExchangeRate()
    {
        CurrencyCode = string.Empty;
        Rate = 1.0m;
    }

    /// 
    /// The three letter ISO code for the Exchange Rate, e.g. USD
    /// 
    public string CurrencyCode { get; set; }

    /// 
    /// The conversion rate of this currency from the base currency
    /// 
    public decimal Rate { get; set; }

    /// 
    /// When was this exchange rate updated from the data source (the data XML feed)
    /// 
    public DateTime UpdatedOn { get; set; }

    /// 
    /// Format the rate into a string with the currency code, e.g. "USD 0.72543"
    /// 
    /// 
    public override string ToString()
    {
        return $"{CurrencyCode} {Rate}";
    }
}