public static Money operator *(Money left, Money right) { EnsureSameCurrency(left, right); HarmonizeDecimalPlaces(ref left, ref right); var product = Convert.ToDouble(left._units)*Convert.ToDouble(right._units); var factor = Math.Pow(10, left._places*2); product /= factor; var result = new Money(left._currencyInfo, product); return result; }
public static Money operator /(Money left, Money right) { EnsureSameCurrency(left, right); HarmonizeDecimalPlaces(ref left, ref right); var quotient = Convert.ToDouble(left._units)/Convert.ToDouble(right._units); var result = new Money(left._currencyInfo, quotient); return result; }