jQuery Plugin For Flexible Loan and Interest Calculation - Accrue.js

File Size: 1.31 MB
Views Total: 16036
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
jQuery Plugin For Flexible Loan and Interest Calculation - Accrue.js

Accrue.js is a simple, fast, flexible jQuery plugin (less than 7 kb) for providing loan and interest calculations e.g. loan amortization schedule, interest comparison calculator on your web page.

Basic Usage:

1. Load the latest version of jQuery javascript library and Accrue.js at the end of the document.

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="jquery.accrue.min.js"></script>

2. Create the Html for a basic loan calculator.

<div class="calculator-loan">
<div class="form"> </div>
<div class="results"></div>

3. Call the plugin on the element you just created.


4. Set up some default options for the plugin that can be overridden

mode: "basic",
operation: "keyup",
default_values: {
    amount: "$7,500",
    rate: "7%",
    rate_compare: "1.49%",
    term: "36m",
field_titles: {
    amount: "Loan Amount",
    rate: "Rate (APR)",
    rate_compare: "Comparison Rate",
    term: "Term"
button_label: "Calculate",
field_comments: {
    amount: "",
    rate: "",
    rate_compare: "",
    term: "Format: 12m, 36m, 3y, 7y"
response_output_div: ".results",
    '<p><strong>Monthly Payment:</strong><br />$%payment_amount%</p>'+
    '<p><strong>Number of Payments:</strong><br />%num_payments%</p>'+
    '<p><strong>Total Payments:</strong><br />$%total_payments%</p>'+
    '<p><strong>Total Interest:</strong><br />$%total_interest%</p>',
response_compare: "Save $%savings% in interest!",
error_text: "Please fill in all fields.",
callback: function ( elem, data ){}



  • v1.0.0: Add currency internationalization support, and remove dollar signs from output templates.


  • function to calculate loan amount


  • Detect submit and image inputs in addition to 'button' elements.


  • Adjusting output shortcodes to match wiki and be more symantic. Making the field selection logic and field output code a bit more readable.


  • Added output options for all loan info in the comparison calculator.


  • A small fix to the field tests when checking for valid existing fields in the form.


This awesome jQuery plugin is developed by jpederson. For more Advanced Usages, please check the demo page or visit the official website.