PDA

View Full Version : Loan Repayment using Compound Interest

Guest.Visitor
09-25-2002, 01:22 PM
I'm looking for a formula and/or a snippet of code to use with the following two calculations: 1) If I know the Loan Amount (Principal Value), the Interest Rate and the Payment Amount, calculate the Number of Payments; 2) If I know the Loan Amount (Principal Value), the Interest Rate and the Number of Payments, calculate the Payment Amount. I have code that works for simple interest, but the formulas that I have using compound interest are either incorrect, or I have not translated them into RPG-IV correctly. I know that the calculation of Number of Payments involves using natural log (C-function log) and have added BNDDIR(QC2LE) to my H-spec and the prototype for the "log" procedure. I have searched the web and found plenty of calculators, but could not find formulas that I can be certain are correct. Thanks in advance for any help you can offer. <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae3e373')

Guest.Visitor
09-26-2002, 08:04 AM
According to Excel Help, this is the formula for compound interest: Effective Interest Rate = (1 + (NominalRate/NumPdsYr))^NumPdsYr - 1 Bill > I'm looking for a formula and/or a snippet of code to use with the following two calculations: > > 1) If I know the Loan Amount (Principal Value), the Interest Rate and the Payment Amount, calculate the Number of Payments; > > 2) If I know the Loan Amount (Principal Value), the Interest Rate and the Number of Payments, calculate the Payment Amount. > > I have code that works for simple interest, but the formulas that I have using compound interest are either incorrect, or I have not translated them into RPG-IV correctly. > > I know that the calculation of Number of Payments involves using natural log (C-function log) and have added BNDDIR(QC2LE) to my H-spec and the prototype for the "log" procedure. > > I have searched the web and found plenty of calculators, but could not find formulas that I can be certain are correct. Thanks in advance for any help you can offer. > > > > Code <'http://www.mcpressonline.com/mc/showcode@@.6ae3e373'>