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

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

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>
<p>
<label>Results:</label>
</p>
<div class="results"></div>
</div>
</div>

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

$(".calculator-loan").accrue();

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",
response_basic: 
    '<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 ){}

Changelog:

2019-04-08

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

2016-01-16

  • function to calculate loan amount

2015-03-17

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

2014-05-24

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

2014-05-14

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

2014-04-02

  • 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.