예제 #1
0
 def fuzzy_sum(self, currency, rounding=ROUND_UP):
     a = Money.ZEROS[currency].amount
     fuzzy = False
     for m in self:
         if m.currency == currency:
             a += m.amount
         elif m.amount:
             a += m.convert(currency, rounding=None).amount
             fuzzy = True
     r = Money(a, currency, rounding=rounding)
     r.fuzzy = fuzzy
     return r
예제 #2
0
 def fuzzy_sum(self, currency, rounding=ROUND_UP):
     a = ZERO[currency].amount
     fuzzy = False
     for m in self:
         if m.currency == currency:
             a += m.amount
         elif m.amount:
             a += m.amount * website.currency_exchange_rates[(m.currency, currency)]
             fuzzy = True
     r = Money(a.quantize(D_CENT, rounding=rounding), currency)
     r.fuzzy = fuzzy
     return r
예제 #3
0
 def fuzzy_sum(self, currency):
     a = ZERO[currency].amount
     fuzzy = False
     for m in self:
         if m.currency == currency:
             a += m.amount
         elif m.amount:
             a += m.amount * website.currency_exchange_rates[(m.currency, currency)]
             fuzzy = True
     r = Money(a, currency)
     r.fuzzy = fuzzy
     return r
예제 #4
0
 def fuzzy_sum(self, currency, rounding=ROUND_UP):
     a = Money.ZEROS[currency].amount
     fuzzy = False
     for m in self:
         if m.currency == currency:
             a += m.amount
         elif m.amount:
             a += m.convert(currency, rounding=None).amount
             fuzzy = True
     r = Money(a, currency, rounding=rounding)
     r.fuzzy = fuzzy
     return r
예제 #5
0
 def fuzzy_sum(self, currency):
     a = ZERO[currency].amount
     fuzzy = False
     for m in self:
         if m.currency == currency:
             a += m.amount
         elif m.amount:
             a += m.amount * website.currency_exchange_rates[(m.currency,
                                                              currency)]
             fuzzy = True
     r = Money(a, currency)
     r.fuzzy = fuzzy
     return r