Adds a compound period change. |
|
Sample
var c = plugins.amortization.newCalculation();
c.addRateChange(r, new Date(2005, 0, 1));
c.addCompoundPeriodChange(12, new Date(2005, 0, 1));
c.addLoan(2000, new Date(2005, 0, 1));
c.addPayment(500, new Date(2005, 1, 28), null, 12, 5, 31);
|
|
|
|
|
(amount, firstDate, [lastDate], [period], [number], [startday]) |
|
|
Parameters amount
firstDate
[lastDate]
[period]
[number]
[startday] |
|
Sample
var c = plugins.amortization.newCalculation();
c.addRateChange(r, new Date(2005, 0, 1));
c.addCompoundPeriodChange(12, new Date(2005, 0, 1));
c.addLoan(2000, new Date(2005, 0, 1));
c.addPayment(500, new Date(2005, 1, 28), null, 12, 5, 31);
|
|
|
|
|
(amount, firstDate, [lastDate], [period], [number], [startday]) |
|
|
Parameters amount
firstDate
[lastDate]
[period]
[number]
[startday] |
|
Sample
var c = plugins.amortization.newCalculation();
c.addRateChange(r, new Date(2005, 0, 1));
c.addCompoundPeriodChange(12, new Date(2005, 0, 1));
c.addLoan(2000, new Date(2005, 0, 1));
c.addPayment(500, new Date(2005, 1, 28), null, 12, 5, 31);
|
|
|
|
|
Sets a new interest rate. |
|
Sample
var c = plugins.amortization.newCalculation();
c.addRateChange(r, new Date(2005, 0, 1));
c.addCompoundPeriodChange(12, new Date(2005, 0, 1));
c.addLoan(2000, new Date(2005, 0, 1));
c.addPayment(500, new Date(2005, 1, 28), null, 12, 5, 31);
|
|
|
|
|
calculateAmortizationSchedule |
|
calculateAmortizationSchedule |
|
|
Calculates the amortization schedule. |
|
Sample
plugins.amortization.calculateAmortizationSchedule();
|
|
|
|
|
Gets the amortization schedule as a JSDataSet. |
|
Sample
plugins.amortization.getAmortizationSchedule();
|
|
|
|
|
Returns the error that remains when solving for the unknown.
Please note that the error should be less or equal to 1E-8 - otherwise, the solveForUnknown value is incorrect. |
|
Sample
//Returns the error that remains when solving for the unknown.
Please note that the error should be less or equal to 1E-8 - otherwise, the solveForUnknown value is incorrect.
var c = plugins.amortization.newCalculation();
// sets the rate to -1 for unknown.
c.addRateChange(-1, new Date(2005, 0, 1));
c.addCompoundPeriodChange(12, new Date(2005, 0, 1));
c.addLoan(2000, new Date(2005, 0, 1));
var lastDate = null;
var period = 12;
var number_count = 5;
var startday = 31;
c.addPayment(500, new Date(2005, 1, 28), lastDate, period,number_count, startday);
// solves for the interest rate.
c.solveForUnknown();
// gets the interest rate and the error in the calculation.
// which should be small (otherwise the calculation did
// not converge for some reason.
var r = c.getUnknown();
var e = c.getError();
|
|
|
|
|
Returns all the amortization events - such as rate changes, loan events, payment events, compounding period changes. |
|
Sample
plugins.amortization.getEvents();
|
|
|
|
|
Gets the rest balance after the amortization schedule. |
|
Sample
var rb = plugins.amortization.getRestBalance();
|
|
|
|
|
Returns the solveForUnknown value. |
|
Sample
plugins.amortization.getUnknown();
|
|
|
|
|
Returns true if the period is valid, or false if the period is not valid. |
|
Sample
//Returns true if the period is valid, or false if the period is not valid.
var v_period = plugins.amortization.isValidPeriod(12);
|
|
|
|
|
Rounds a number up to the nearest cents. |
|
Sample
//Rounds a number up to the nearest cents.
//rounds the number up to 34.35
var rm = plugins.amortization.roundMoney(34.349384);
|
|
|
|
|
Returns true if successful or false if the call failed. |
|
Sample
//Returns true if successful or false if the call failed.
plugins.amortization.solveForUnknown();
|
|
|
|
|
Sorts the amortization events ascending by date. |
|
Sample
//Sorts the amortization events ascending by date.
plugins.amortization.sortEvents();
|
|
|
|
|
|