Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def calculateRealInterest(amount, months, percentPerMonth):
- interestAmount = amount * percentPerMonth / 100 * months; #总手续费
- amountPermonth = amount / months; #每期占用银行金额
- occupyMonths = (1 + months) * (months / 2); #总占用月数
- occupyYears = occupyMonths / 12; #占用年数
- occupyAmountForOneYear = amountPermonth * occupyYears; #相当于占用了一年的金额
- realInterest = interestAmount / occupyAmountForOneYear; #实际年化利率
- return {
- '总手续费': interestAmount,
- '相当于占用了一年的金额': occupyAmountForOneYear,
- '实际年化利率': realInterest
- }
Add Comment
Please, Sign In to add comment