Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
Table Body (tbody) |
---|
id | addCompoundPeriodChange |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
addCompoundPeriodChange |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| addCompoundPeriodChange |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Adds a compound period change. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters newPeriod date |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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);
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| addLoan |
Span |
---|
| (amount, firstDate, [lastDate], [period], [number], [startday]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Adds a loan. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters amount firstDate [lastDate] [period] [number] [startday] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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);
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
addPayment |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| addPayment |
Span |
---|
| (amount, firstDate, [lastDate], [period], [number], [startday]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Adds a payment. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters amount firstDate [lastDate] [period] [number] [startday] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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);
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
addRateChange |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| addRateChange |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sets a new interest rate. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters newRate date |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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);
|
|
|
|
|
Table Body (tbody) |
---|
id | calculateAmortizationSchedule |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
calculateAmortizationSchedule |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| calculateAmortizationSchedule |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Calculates the amortization schedule. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
plugins.amortization.calculateAmortizationSchedule();
|
|
|
|
|
Table Body (tbody) |
---|
id | getAmortizationSchedule |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getAmortizationSchedule |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSDataSet |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getAmortizationSchedule |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the amortization schedule as a JSDataSet. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
plugins.amortization.getAmortizationSchedule();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getError |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
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. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//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();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| JSDataSet |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getEvents |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns all the amortization events - such as rate changes, loan events, payment events, compounding period changes. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
plugins.amortization.getEvents();
|
|
|
|
|
Table Body (tbody) |
---|
id | getRestBalance |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getRestBalance |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getRestBalance |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Gets the rest balance after the amortization schedule. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var rb = plugins.amortization.getRestBalance();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getUnknown |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getUnknown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns the solveForUnknown value. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
plugins.amortization.getUnknown();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
isValidPeriod |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| isValidPeriod |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns true if the period is valid, or false if the period is not valid. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters period |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Returns true if the period is valid, or false if the period is not valid.
var v_period = plugins.amortization.isValidPeriod(12);
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
roundMoney |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Number |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| roundMoney |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Rounds a number up to the nearest cents. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters amount |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Rounds a number up to the nearest cents.
//rounds the number up to 34.35
var rm = plugins.amortization.roundMoney(34.349384);
|
|
|
|
|
Table Body (tbody) |
---|
id | solveForUnknown |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
solveForUnknown |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| solveForUnknown |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns true if successful or false if the call failed. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Returns true if successful or false if the call failed.
plugins.amortization.solveForUnknown();
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
sortEvents |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| void |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| sortEvents |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sorts the amortization events ascending by date. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns void |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
//Sorts the amortization events ascending by date.
plugins.amortization.sortEvents();
|
|
|
|
|
|