ruleof78.ijs

Script: ~addons/finance/finexec/basicfinance/ruleof78.ijs
Contributor: William Szuch
Updated: 2022 6 25
Depend: nil
Definitions: loaded to locale base
Status: todo equations
Script source: rule0f78.ijs

Rule of 78 outstanding monthly balance calculations.
Equations:
NF

Definitions

R ruleof78

ruleof78 (verb)

Form explicit
Outstanding balances under the Rule of 78
Generates the outstanding balance at the end of each month
after the periodic monthly loan repayment for a loan
using the Rule of 78.
If the loan repayments are less than amount of loan
the result is message and no calculation is made.
(1) loan repayments are at the end of the month
(2) loan balances are rounded to the nearer cent

Syntax

([Opt])ruleof78(A;M;X)
[Opt] = disply option
        default: unboxed table with no headings
        1 = boxed table with heading and summary
A = amount of loan
M = term of loan in integer months
X = amount of monthly loan repayment

Example

   ruleof78 (1000;12;110)
 0   0   1000
 1 110 939.23
 2 110 874.36
 3 110 805.38
 4 110 732.31
 5 110 655.13
 6 110 573.85
 7 110 488.46
 8 110 398.97
 9 110 305.38
10 110 207.69
11 110  105.9
12 110      0

Example

 Try these examples:
   (1)ruleof78(1000;12;110)
   (1)ruleof78(1000;110;12)
   rule7of78(1000;60;24)
   ruleof78(1200;100;12)
   ruleof78(3600;100;36)
   ruleof78(1000;70;12)   NB. repayments to low
 Further examples:
   require 'plot'
   plot 2{"1 [ ruleof78  (1000;110;12)
   plot 2{"1 [ ruleof78 (1000;200;12)  NB. Rule of 78 not suitable
   plot 2{"1 [ ruleof78 (1000;200;24)  NB. Rule of 78 not suitable