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); } }
public static DoubleCy Min(DoubleCy c1, DoubleCy c2) { if (c1 <= c2) { return(c1); } return(c2); }
public static DoubleCy Max(DoubleCy c1, DoubleCy c2) { if (c1 >= c2) { return(c1); } return(c2); }
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); }
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; }
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)); }
static DoubleCy() { Zero = new DoubleCy(); }
public static DoubleCy Round(DoubleCy c, int digits) { return(new DoubleCy(Math.Round(c.Value, digits), c.Symbol)); }
public DoubleCy(DoubleCy kwota) { this.value = kwota.Value; this.symbol = kwota.Symbol; this.checkValue(); }
public static bool EqualSymbols(DoubleCy c1, DoubleCy c2) { return(c1.Symbol == c2.Symbol); }
public bool Equals(DoubleCy dcy) { return((this.value == dcy.value) && (this.Symbol == dcy.Symbol)); }