home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 March / VPR9703A.ISO / MS_DEV / VID / SERVER / ASF / DATA.Z / finance.asp < prev    next >
Text File  |  1996-10-22  |  1KB  |  63 lines

  1. <HTML> 
  2. <HEAD><TITLE>Future Value Calculation</TITLE> 
  3. </HEAD> 
  4. <BODY BGCOLOR="#FFFFFF"><FONT FACE="ARIAL,HELVETICA">
  5.  
  6. <% 
  7. ' Check to see if an Annual Percentage Rate 
  8. ' was entered 
  9. If IsNumeric(Request("APR")) Then 
  10. ' Ensure proper form. 
  11. If Request("APR") > 1 Then 
  12. APR = Request("APR") / 100 
  13. Else 
  14. APR = Request("APR") 
  15. End If 
  16. Else 
  17. APR = 0 
  18. End If 
  19.  
  20. ' Check to see if a value for Total Payments 
  21. ' was entered 
  22. If IsNumeric(Request("TotPmts")) Then 
  23. TotPmts = Request("TotPmts") 
  24. Else 
  25. TotPmts = 0 
  26. End If
  27.  
  28. ' Check to see if a value for Payment Amount 
  29. ' was entered 
  30. If IsNumeric(Request("Payment")) Then 
  31. Payment = Request("Payment") 
  32. Else 
  33. Payment = 0 
  34. End If 
  35.  
  36. ' Check to see if a value for Account Present Value 
  37. ' was entered 
  38. If IsNumeric(Request("PVal")) Then 
  39. PVal = Request("PVal") 
  40. Else 
  41. PVal = 0 
  42. End If
  43.  
  44. If Request("PayType") = "Beginning" Then 
  45. PayType = 1 ' BeginPeriod 
  46. Else 
  47. PayType = 0 ' EndPeriod 
  48. End If 
  49.  
  50. ' Create an instance of the Finance object 
  51. Set Finance = Server.CreateObject("MS.Finance") 
  52.  
  53. ' Use your instance of the Finance object to 
  54. ' calculate the future value of the submitted 
  55. ' savings plan using the HTML form and the 
  56. ' CalcFV method 
  57. FVal = Finance.CalcFV(APR / 12, TotPmts, -Payment, -PVal, PayType) 
  58. %>
  59.  
  60. <H3>Your savings will be worth <% = FVal %>.</H3> </FONT>
  61. </BODY> 
  62. </HTML> 
  63.