def progression(self, payment, M): principle = self.amount months = self.m if self.dex: index = storage.getInflation()/1200.0 else: index = 0 interest =(self.interest/100.0)/12.0 pay = [] intData = [] debt = [self.amount] i = 0 while principle > 0: intPay = principle*((1+index)*(1+interest)-1) fee = min(self.baseFee, principle) principle -= fee if i<M: payment = min(payment,principle) else: payment = 0 principle -= payment pay.append(round(fee+payment+intPay)) intData.append(intPay) debt.append(principle) i += 1 return [pay,debt,intData]
def __init__(self, name, amount, interest, index, bound): self.n = name self.a = amount self.p = interest/100.0 self.dex = index self.b = bound self.influx = storage.getInflation()/100.0 self.minflux = self.influx/12.0 self.mrates = self.p/12.0 #manadarlegir vextir reiknadir ut fra arsvoxtum if(index): self.adjustedp = (1+self.mrates)*(1+self.minflux)-1 else: self.adjustedp = self.mrates