Financial Calculations

Crittar

Member
Lostozone posted a thread recently asking about finacial calculations.
Unfortunately I can't seem to access that thread at the moment, however I believe the following code will be helpful in his situation.

Code:
DEFINE VARIABLE c           AS DECIMAL                          NO-UNDO.
DEFINE VARIABLE P           AS DECIMAL                          NO-UNDO.
DEFINE VARIABLE r           AS DECIMAL                          NO-UNDO.
DEFINE VARIABLE t           AS DECIMAL                          NO-UNDO.

/*

   Assign the 3 variables you know. Use the appropriate formula
   from the list shown below to calculate the remaining variable.
   
ASSIGN
  p = 8500
  r = .12
  t = 24
  c = 8748.21.
*/

/* Formula for principle  (p) */  
ASSIGN
  p = c / exp(1 + (r / 100),t).

/* Formula for charge  (c) */
ASSIGN
  c = p * exp((1 + (r / 100)),t).
  
/* Formula for rate  (r) */
ASSIGN
  r = (exp((c / p),(1 / t)) - 1) * 100.

/* Formula for term  (t) */
ASSIGN
  t = log(c / p) / log(1 + r / 100).

Hope this is helpful.
 
Back
Top