1 Finance::Amortization(3
\bU)
\bser Contributed Perl Documentati
\bFo
\bin
\bnance::Amortization(3)
6 Finance::Amortization - Simple Amortization Schedules
8 S
\bSY
\bYN
\bNO
\bOP
\bPS
\bSI
\bIS
\bS
9 use Finance::Amortization
13 $amortization = new Finance::Amortization(principal => 100000, rate =
14 0.06/12, periods = 360);
16 # get the balance after a the twelveth period
18 $balance = $amortization->balance(12)
20 # get the interest paid during the twelfth period
22 $interest = $amortization->interest(12);
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.
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.)
37 $am = Finance::Amortization->new(principal => 0, rate => 0, periods =>
38 0, compounding => 12, precision => 2);
40 Creates a new amortization object. Calling interface is hash style.
41 The fields principal, rate, and periods are available, all defaulting
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
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.
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.
59 _
\br_
\ba_
\bt_
\be_
\b(_
\b)
61 $rate_per_period = $am->_
\br_
\ba_
\bt_
\be_
\b(_
\b)
63 returns the interest rate per period. Ignores any arguments.
65 _
\bp_
\br_
\bi_
\bn_
\bc_
\bi_
\bp_
\ba_
\bl_
\b(_
\b)
67 $initial_value = $am->_
\bp_
\br_
\bi_
\bn_
\bc_
\bi_
\bp_
\ba_
\bl_
\b(_
\b)
69 returns the initial principal being amortized. Ignores any arguments.
71 _
\bp_
\be_
\br_
\bi_
\bo_
\bd_
\bs_
\b(_
\b)
73 $number_of_periods = $am->_
\bp_
\be_
\br_
\bi_
\bo_
\bd_
\bs_
\b(_
\b)
75 returns the number of periods in which the principal is being amor-
76 tized. Ignores any arguments.
78 _
\bp_
\ba_
\by_
\bm_
\be_
\bn_
\bt_
\b(_
\b)
80 $pmt = $am->_
\bp_
\ba_
\by_
\bm_
\be_
\bn_
\bt_
\b(_
\b)
82 returns the payment per period. This method will cache the value the
83 first time it is called.
85 b
\bba
\bal
\bla
\ban
\bnc
\bce
\be(
\b(n
\bn)
\b)
87 $balance = $am->balance(12);
89 Returns the balance of the amortization after the period given in the
92 i
\bin
\bnt
\bte
\ber
\bre
\bes
\bst
\bt(
\b(n
\bn)
\b)
94 $interest = $am->interest(12);
96 Returns the interest paid in the period given in the argument
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.
104 Use Math::BigRat for the calculations.
106 Provide amortizers for present value, future value, annuities, etc.
108 Allow for caching calculated values.
110 Provide output methods and converters to various table modules.
111 HTML::Table, Text::Table, and Data::Table come to mind.
113 Write better test scripts.
115 Better checking for errors and out of range input. Return undef in
118 Use a locale dependent value to set an appropriate default for preci-
119 sion in the _
\bn_
\be_
\bw_
\b(_
\b) method.
121 L
\bLI
\bIC
\bCE
\bEN
\bNS
\bSE
\bE
122 None. This entire module is in the public domain.
124 A
\bAU
\bUT
\bTH
\bHO
\bOR
\bR
125 Nathan Wagner <nw@hydaspes.if.org>
127 This entire module is written by me and placed into the public domain.
131 perl v5.8.6 2007-05-27 Finance::Amortization(3)