예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        protected override Currency Subtract(Currency currency)
        {
            CurrencyWithNoCents c = (CurrencyWithNoCents)currency;

            return(new CurrencyWithNoCents(_units - c._units, this.CurrencyInfo));
        }