Example #1
0
 private static void Equalable(DoubleCy c1, DoubleCy c2)
 {
     if (((c1.Value != 0.0) && (c2.Value != 0.0)) && (c1.Symbol != c2.Symbol))
     {
         throw new VariousCurrencyException(c1.Symbol, c2.Symbol);
     }
 }
Example #2
0
 public static DoubleCy Min(DoubleCy c1, DoubleCy c2)
 {
     if (c1 <= c2)
     {
         return(c1);
     }
     return(c2);
 }
Example #3
0
 public static DoubleCy Max(DoubleCy c1, DoubleCy c2)
 {
     if (c1 >= c2)
     {
         return(c1);
     }
     return(c2);
 }
Example #4
0
        object ISumable.Sum(object sum)
        {
            if (sum is string)
            {
                return(sum);
            }
            DoubleCy cy = (DoubleCy)sum;

            if (cy.Symbol != this.Symbol)
            {
                return("r\x00f3żne waluty");
            }
            return(((DoubleCy)sum) + this);
        }
Example #5
0
        private void Test()
        {
            DoubleCy cy = Zero + 0;

            cy += (DoubleCy)0L;
            cy += 0M;
            cy += 0.0;
            cy += 0.0;
            cy += 0;
            cy += 0;
            cy -= 0;
            cy -= (DoubleCy)0L;
            cy -= 0M;
            cy -= 0.0;
            cy -= 0.0;
            cy -= 0;
            cy += 0;
        }
Example #6
0
        int IComparable.CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }
            if (!(obj is DoubleCy))
            {
                throw new ArgumentException();
            }
            DoubleCy cy  = (DoubleCy)obj;
            int      num = string.Compare(this.Symbol, cy.Symbol, true);

            if (num != 0)
            {
                return(num);
            }
            return(this.value.CompareTo(cy.value));
        }
Example #7
0
 static DoubleCy()
 {
     Zero = new DoubleCy();
 }
Example #8
0
 public static DoubleCy Round(DoubleCy c, int digits)
 {
     return(new DoubleCy(Math.Round(c.Value, digits), c.Symbol));
 }
Example #9
0
 public DoubleCy(DoubleCy kwota)
 {
     this.value  = kwota.Value;
     this.symbol = kwota.Symbol;
     this.checkValue();
 }
Example #10
0
 public static bool EqualSymbols(DoubleCy c1, DoubleCy c2)
 {
     return(c1.Symbol == c2.Symbol);
 }
Example #11
0
 public bool Equals(DoubleCy dcy)
 {
     return((this.value == dcy.value) && (this.Symbol == dcy.Symbol));
 }