等额本金等额本息计算器

等额本息月还款计算器

http://www.qzgjj.com/Index/Calculator

 

等额本金月还款计算器

http://www.qzgjj.com/Index/Calculator

 

税后计算器

http://www.bankrate.com.cn/tools/Salary-calculator.html

 

贷款计算器

http://www.yinhang.com/fangdai/shangyedaikuanjisuanqi.html

http://www.zzgjj.gov.cn/jsq/return1.asp

可以使用JavaScript编写一个简单的房贷计算器。以下是等额本息等额本金计算的示例代码: 等额本息计算: ```javascript function calculateEqualPrincipalAndInterest(totalAmount, years, rate) { var monthlyRate = rate / 12; var totalMonths = years * 12; var monthlyPayment = totalAmount * monthlyRate * Math.pow(1 + monthlyRate, totalMonths) / (Math.pow(1 + monthlyRate, totalMonths) - 1); var totalPayment = monthlyPayment * totalMonths; var interest = totalPayment - totalAmount; return { monthlyPayment: monthlyPayment.toFixed(2), totalPayment: totalPayment.toFixed(2), interest: interest.toFixed(2) }; } ``` 等额本金计算: ```javascript function calculateEqualPrincipal(totalAmount, years, rate) { var monthlyRate = rate / 12; var totalMonths = years * 12; var principalPerMonth = totalAmount / totalMonths; var totalInterest = 0; var monthlyPayments = []; for (var i = 0; i < totalMonths; i++) { var interest = (totalAmount - i * principalPerMonth) * monthlyRate; var monthlyPayment = principalPerMonth + interest; totalInterest += interest; monthlyPayments.push(monthlyPayment.toFixed(2)); } var totalPayment = totalAmount + totalInterest; return { monthlyPayments: monthlyPayments, totalPayment: totalPayment.toFixed(2), totalInterest: totalInterest.toFixed(2) }; } ``` 使用这些函数,你可以在网页上创建一个表单,让用户输入房贷金额、贷款期限和利率,并根据用户选择的计算方式(等额本息等额本金)计算月供、总还款额和利息。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值