Created
May 14, 2012 07:43
-
-
Save hiroshineya/2692512 to your computer and use it in GitHub Desktop.
元利均等返済年間返済額算出
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 元利均等返済年間返済額算出 | |
| * 金利の目安 | |
| * http://www.flat35.com/kinri/index.php/rates/top (2012/05現在) | |
| * 【フラット35】 | |
| * 返済期間が21年以上35年以下の場合の金利幅 2.070%~3.020% | |
| * (取扱金融機関が提供する金利で最も多いのは2.070%) | |
| * 返済期間が20年以下の場合の金利幅 1.760%~2.710% | |
| * (取扱金融機関が提供する金利で最も多いのは1.760%) | |
| * 【フラット50】 | |
| * 返済期間が36年以上50年以下の場合の金利幅 2.850%~3.600% | |
| * (取扱金融機関が提供する金利で最も多いのは3.100%) | |
| * | |
| * @param loanAmount 借入額(円) | |
| * @param paybackYears 返済期間(年) | |
| * @param interestRate 金利(年利) | |
| */ | |
| function calcFixedInterestRateAnnualPayback(loanAmount, paybackYears, interestRate) { | |
| var r = interestRate / 1200; // 年利を月利に変換。同時に1/100に。 | |
| var paybackTimes = paybackYears * 12; // 返済回数(毎月返済) | |
| // 返済額算出 | |
| var paybackCost = ( loanAmount * r * Math.pow((1+r), paybackTimes) ) / ( Math.pow((1+r), paybackTimes) - 1 ); | |
| paybackCost = Math.round( paybackCost ); | |
| // 年間額へ | |
| paybackCost *= 12; | |
| return paybackCost; | |
| }; |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
first release