Annuity Script
Webb - all rights reserved - ©2004
spacer
Author - Gert-Jan Vons
Email: vons@iname.com
Webpage:

Summary: Annuity calculations

Instructions: A RPN script to make annuity calculations

The fields are used as follows:

sIR    - set Yearly Interest Rate in %
sFV    - set Future Value
sType  - set to 0 if payment at beginning of the
         month, set to 1 if at the end.
sPV    - set Present Value
sN     - set Number of months
sPMT   - set Monthy Payment

PV  - calculate Present Value
N   - calculate the Number of months
PMT - calculate Monthly Payment


Code:

RPN.2.f+2 \ Annuity
[a]1xb+xcP1-xb/1xf(xb+)*xd*xe+1xb+xcP/ng1Xa;
[c]1xf(xb+)xd*xb/g1xe-r2xa+/l1xb+l/;
[d]1xb+xcP1-xb/1xf(xb+)*1xb+xcPxa*xe+nr2/g1Xd;
"Annuity";
"_sIR: set annual interest rate" #'1200'/Xb;
"_sFV: set future value" Xe;
"_sType: set 0/1 if payment at \beginning/end of month" Xf;
~
"_sPV:set present value" Xa;
"_sN: set # of monthly pay-\ments" Xc;
"_sPMT:set monthly payment" Xd;
~
"PV: calculate present value" Ca;
"N: calculate number of months" Cc;
"PMT: calculate monthly pay-\ment" Cd;