8 use Finance::Amortization;
11 # this program generates a 30 year amortization table on a $200,000
14 my $am = Finance::Amortization->new(principal => 200000, rate => .07,
15 periods => 30*12, compounding => 12, precision => 2);
18 #balance, interest, payment
20 my @cols = qw(Period Payment Interest Principal Balance);
22 my $table = HTML::Table->new(0, 5);
24 $table->addRow(@cols);
25 $table->setRowHead(1);
27 my $pmt = $am->payment;
30 my ($int, $bal) = ($am->interest($_),$am->balance($_));
31 $table->addRow($_, $pmt, $int, $pmt-$int, $bal);