Guest User

Untitled

a guest
Dec 13th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. def calculateRealInterest(amount, months, percentPerMonth):
  2.  
  3. interestAmount = amount * percentPerMonth / 100 * months; #总手续费
  4.  
  5. amountPermonth = amount / months; #每期占用银行金额
  6. occupyMonths = (1 + months) * (months / 2); #总占用月数
  7. occupyYears = occupyMonths / 12; #占用年数
  8.  
  9. occupyAmountForOneYear = amountPermonth * occupyYears; #相当于占用了一年的金额
  10.  
  11. realInterest = interestAmount / occupyAmountForOneYear; #实际年化利率
  12.  
  13. return {
  14. '总手续费': interestAmount,
  15. '相当于占用了一年的金额': occupyAmountForOneYear,
  16. '实际年化利率': realInterest
  17. }
Add Comment
Please, Sign In to add comment