]> pd.if.org Git - amortization/blob - README
initial commit from pause
[amortization] / README
1 Finance::Amortization(3\bU)\bser Contributed Perl Documentati\bFo\bin\bnance::Amortization(3)
2
3
4
5 N\bNA\bAM\bME\bE
6        Finance::Amortization - Simple Amortization Schedules
7
8 S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
9        use Finance::Amortization
10
11        # make a new schedule
12
13        $amortization = new Finance::Amortization(principal => 100000, rate =
14        0.06/12,      periods = 360);
15
16        # get the balance after a the twelveth period
17
18        $balance = $amortization->balance(12)
19
20        # get the interest paid during the twelfth period
21
22        $interest = $amortization->interest(12);
23
24 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
25        Finance::Amortization is a simple object oriented interface to an amor-
26        tization table.  Pass in the principal to be amortized, the number of
27        payments to be made, and the interest rate per payment.  It will calcu-
28        late the rest on demand, and provides a few methods to ask for the
29        state of the table after a given number of periods.
30
31        Finance::Amortization is written in pure perl and does not depend on
32        any other modules.  It exports no functions; all access is via methods
33        called on an amortization object.  (Except for _\bn_\be_\bw_\b(_\b), of course.)
34
35        _\bn_\be_\bw_\b(_\b)
36
37        $am = Finance::Amortization->new(principal => 0, rate => 0, periods =>
38        0,      compounding => 12, precision => 2);
39
40        Creates a new amortization object.  Calling interface is hash style.
41        The fields principal, rate, and periods are available, all defaulting
42        to zero.
43
44        Compounding is a parameter which sets how many periods the rate is com-
45        pounded over.  Thus, if each amortization period is one month, setting
46        compounding to 12 (the default), will make the rate an annual rate.
47        That is, the interest rate per period is the rate specified, divided by
48        the compounding.
49
50        So, to get an amortization for 30 years on 200000, with a 6% annual
51        rate, you would call new(principal => 200000, periods => 12*30, rate =>
52        0.06), the compounding will default to 12, and so the rate will work
53        out right for monthly payments.
54
55        precision is used to specify the number of decimal places to round to
56        when returning answers.  It defaults to 2, which is appropriate for US
57        currency and many others.
58
59        _\br_\ba_\bt_\be_\b(_\b)
60
61        $rate_per_period = $am->_\br_\ba_\bt_\be_\b(_\b)
62
63        returns the interest rate per period.  Ignores any arguments.
64
65        _\bp_\br_\bi_\bn_\bc_\bi_\bp_\ba_\bl_\b(_\b)
66
67        $initial_value = $am->_\bp_\br_\bi_\bn_\bc_\bi_\bp_\ba_\bl_\b(_\b)
68
69        returns the initial principal being amortized.  Ignores any arguments.
70
71        _\bp_\be_\br_\bi_\bo_\bd_\bs_\b(_\b)
72
73        $number_of_periods = $am->_\bp_\be_\br_\bi_\bo_\bd_\bs_\b(_\b)
74
75        returns the number of periods in which the principal is being amor-
76        tized.  Ignores any arguments.
77
78        _\bp_\ba_\by_\bm_\be_\bn_\bt_\b(_\b)
79
80        $pmt = $am->_\bp_\ba_\by_\bm_\be_\bn_\bt_\b(_\b)
81
82        returns the payment per period.  This method will cache the value the
83        first time it is called.
84
85        b\bba\bal\bla\ban\bnc\bce\be(\b(n\bn)\b)
86
87        $balance = $am->balance(12);
88
89        Returns the balance of the amortization after the period given in the
90        argument
91
92        i\bin\bnt\bte\ber\bre\bes\bst\bt(\b(n\bn)\b)
93
94        $interest = $am->interest(12);
95
96        Returns the interest paid in the period given in the argument
97
98 B\bBU\bUG\bGS\bS
99        This module uses perl's floating point for financial calculations.
100        This may introduce inaccuracies and/or make this module unsuitable for
101        serious financial applications.
102
103 T\bTO\bOD\bDO\bO
104        Use Math::BigRat for the calculations.
105
106        Provide amortizers for present value, future value, annuities, etc.
107
108        Allow for caching calculated values.
109
110        Provide output methods and converters to various table modules.
111        HTML::Table, Text::Table, and Data::Table come to mind.
112
113        Write better test scripts.
114
115        Better checking for errors and out of range input.  Return undef in
116        these cases.
117
118        Use a locale dependent value to set an appropriate default for preci-
119        sion in the _\bn_\be_\bw_\b(_\b) method.
120
121 L\bLI\bIC\bCE\bEN\bNS\bSE\bE
122        None.  This entire module is in the public domain.
123
124 A\bAU\bUT\bTH\bHO\bOR\bR
125        Nathan Wagner <nw@hydaspes.if.org>
126
127        This entire module is written by me and placed into the public domain.
128
129
130
131 perl v5.8.6                       2007-05-27          Finance::Amortization(3)