Amortization Schedule & Payment Calculator
How do I make an amortization schedule & payment calculator?
Using Angular for easy display and such. Useful tool and a fun JS exercise.. What is a amortization schedule & payment calculator? How do you make a amortization schedule & payment calculator? This script and codes were developed by Bryan Fillmer on 11 December 2022, Sunday.
Amortization Schedule & Payment Calculator - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Amortization Schedule & Payment Calculator</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='http://maxcdn.bootstrapcdn.com/bootswatch/3.2.0/flatly/bootstrap.min.css'> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { padding: 2em;
}
section { max-width: 33em; margin: 0 auto;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <body ng-app="AmortApp"> <section ng-controller="AmortCalc as calc"> <h2>Amortization Schedule & Payment Calculator</h2> <form class="form-horizontal"> <fieldgroup> <legend>Loan Information</legend> <ul class="list-unstyled"> <li class="form-group"> <label class="col-sm-4 control-label">Principal</label> <div class="col-sm-6"><input type="number" class="form-control" ng-model="calc.principal" ng-change="calc.calcMonthlyPaymentAmount()"></div> </li> <li class="form-group"> <label class="col-sm-4 control-label">Annual Interest Rate</label> <div class="col-sm-3"><input type="number" class="form-control" placeholder="0.0%" ng-model="calc.interest" ng-change="calc.calcMonthlyPaymentAmount()"></div> </li> <li class="form-group"> <label class="col-sm-4 control-label">Years</label> <div class="col-sm-3"><input type="number" class="form-control" ng-model="calc.payments" ng-change="calc.calcMonthlyPaymentAmount()"></div> </li> </ul> <h4 class="row" ng-show="calc.monthlyPaymentAmount"> <div class="col-sm-6 text-muted">Per Month Payment:</div> <div class="col-sm-6">{{calc.monthlyPaymentAmount | currency}}</div> <div class="col-sm-6 text-muted">Total Payout:</div> <div class="col-sm-6">{{calc.totalPayoutAmount | currency}}</div> <div class="col-sm-6 text-muted">Total Interest:</div> <div class="col-sm-6">{{calc.totalInterestAmount | currency}}</div> </h4> </fieldgroup> </form> </section>
</body> <script src='http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Amortization Schedule & Payment Calculator - Script Codes CSS Codes
body { padding: 2em;
}
section { max-width: 33em; margin: 0 auto;
}
Amortization Schedule & Payment Calculator - Script Codes JS Codes
(function () { /** * * @TODO * 1. Reduce watch frequency on monthly calculation. * 2. Refactor a bit for more sense. * 3. That whole schedule thing. * 4. Form element validation checking. * */ angular.module('AmortApp', [ ]); var AmortCalc = function () { var vm = this; vm.principal = null, vm.interest = null, vm.payments = null, vm.monthlyPaymentAmount = null, vm.totalPayoutAmount = null, vm.totalInterestAmount = null, vm.remainingBalance = null; var monthlyPayment = function (p, i, n) { return ( i * p * Math.pow(1 + i, n) ) / ( Math.pow(1 + i, n) - 1 ); }; var monthlyInterest = function (i) { return (i / 100) / 12; }; vm.calcMonthlyPaymentAmount = function () { if (null === vm.principal || null === vm.interest || null === vm.payments) { return null; } var mInterest = monthlyInterest(vm.interest); vm.monthlyPaymentAmount = monthlyPayment(vm.principal, mInterest, (vm.payments * 12)); vm.totalPayoutAmount = vm.monthlyPaymentAmount * (vm.payments * 12); vm.totalInterestAmount = vm.totalPayoutAmount - vm.principal; }; }; angular.module('AmortApp', [ ]).controller('AmortCalc', AmortCalc);
})();
Developer | Bryan Fillmer |
Username | bfillmer |
Uploaded | December 11, 2022 |
Rating | 3 |
Size | 2,961 Kb |
Views | 12,144 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
JS Playground | 3,242 Kb |
General Tax Calculator | 2,902 Kb |
On A Boat | 2,615 Kb |
Attribute Module CSS Grid Mixins | 5,014 Kb |
Continued Angular Testbed | 2,239 Kb |
Attribute Modules for CSS | 5,810 Kb |
Shopping Site Mockup | 6,977 Kb |
Useful Loading Overlay | 3,833 Kb |
Simple Number Element Controls Demo | 3,384 Kb |
Basic Javascript Chaining | 2,399 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Price | Catcode | 2,623 Kb |
Buttons for autumn | Nikazawila | 1,795 Kb |
Drop Cap | Gsaiki | 1,571 Kb |
Boxes | H3l1um | 2,563 Kb |
Pure CSS candle light animation by One element | Ksksoft | 2,193 Kb |
A Pen by Manoz | Manoz | 2,424 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
STAR WARS LIGHTSABER | Francoiscoron | 4,420 Kb |
Emberjs Bootstrap Modal Carousel | Somethingkindawierd | 4,233 Kb |
A simple log in form made with css | Mayurelbhar | 2,160 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!