public static Currency GetCurrency(string value, CurrencyInfo info, CultureInfo culture) { switch (info.Code) { case "USD": case "JPY": case "EUR": case "PLN": return(CurrencyWithCents.Parse(value, info, culture)); case "ISK": return(CurrencyWithNoCents.Parse(value, info, culture)); } return(null); }
public static Currency GetCurrency(decimal value, CurrencyInfo info) { switch (info.Code) { case "USD": case "JPY": case "EUR": case "PLN": return(CurrencyWithCents.FromDecimal(value, info)); case "ISK": return(CurrencyWithNoCents.FromDecimal(value, info)); } return(null); }
protected override Currency Subtract(Currency currency) { CurrencyWithNoCents c = (CurrencyWithNoCents)currency; return(new CurrencyWithNoCents(_units - c._units, this.CurrencyInfo)); }