public static float PercentOf(this Price curr, Price orig) { return(orig.RawPrice == 0 ? 0 : curr.RawPrice / orig.RawPrice * 100); }
public static Price Add(this Price a, Price b) { return(new Price(a.RawPrice + b.RawPrice)); }
public static float PercentChange(this Price curr, Price orig) { return(orig.RawPrice == 0 ? 0 : (curr.RawPrice - orig.RawPrice) / orig.RawPrice * 100); }
public static Price Subtract(this Price a, Price b) { return(new Price(a.RawPrice - b.RawPrice)); }