Accrue.js is a jQuery plugin for providing loan and interest calculations on web pages. It's small, fast, flexible, and forgiving.
Small: The minified version of the plugin is under 5kb.
Fast: It loads and executes quickly, and instantly provides results as your user types.
Flexible: Don't want it to calculate on keyup? There's a setting for that. Want to execute your own code every time the the tool calculates? Just provide a callback function. With every setting in the plugin accessible, you can completely customize the experience.
Forgiving: If you don't provide it with fields that are required to perform calculations, it will add them to the bottom of the form. If you don't provide it with a form or results div to begin with, you guessed it - it creates them. It will operate when trained on a completely empty div or use any fields you provide yourself.
Check out the demos to see what it can do.
Enough talk, let's check out some demos!
Grabs three values from the form, and returns general information about a loan.
Grabs four values from the form, and returns general information about a loan.
Grabs three values from the form, and displays a complete amortization schedule for the provided loan information.
Accrue.js is a jQuery plugin, so it requires a version of jQuery to be installed. The only other file you need to get started is
example.css file that's included in the repo is NOT intended to be used with the plugin - it mainly contains styles for the example page, and while some of those styles affect the calculator elements, most of them do not and would just add unnecessary code to your codebase.
To keep the plugin small and flexible, it doesn't include a stylesheet at all, allowing you to set any styles you need/want.
View the wiki for detailed instructions about any of the calculator modes and all the additional options and features.
Visit the project on Github for updates or just download the source and dig in!