This content has been marked as final.
Show 5 replies

1. Re: CF Calculation  so close.. please help?!?
draves Aug 26, 2006 8:44 PM (in response to Newsgroup_User)Maybe you are entering the rate #rr# as a percentage amount instead of dividing it by 100 before using it in the equations. The value in p2 is in scientific or exponential notation. You need to move the decimal place by the 307 positions indicated. 
2. Re: CF Calculation  so close.. please help?!?
Hal B. Helms Aug 26, 2006 9:23 PM (in response to Newsgroup_User)Here's the formula for doing the monthly payment. The APR is going to be considerably harder, as it requires iterative approximations.
<cfset loanAmount = 200000 />
<cfset extraCost = 5000 />
<cfset interestRate = 7.5/1200 />
<cfset numberOfMonths = 360 />
<cfset monthlyPayment = ((loanAmount + extraCost) * interestRate * ((1 + interestRate)^numberOfMonths)) / (((1 + interestRate)^numberOfMonths)  1) />
<cfoutput>
#monthlyPayment#
</cfoutput> 
3. Re: CF Calculation  so close.. please help?!?
Newsgroup_User Aug 27, 2006 9:28 AM (in response to Newsgroup_User)YES good point  my mistake, thanks!

Michael Evangelista
Evangelista Design / Evangelista Consulting, inc.
www.evangelistaweb.com
Custom Small Business Website Solutions
"draves" <webforumsuser@macromedia.com> wrote in message news:ecr4fc$53h$1@forums.macromedia.com...
> Maybe you are entering the rate #rr# as a percentage amount instead of dividing
> it by 100 before using it in the equations. The value in p2 is in scientific
> or exponential notation. You need to move the decimal place by the 307
> positions indicated.
>

4. Re: CF Calculation  so close.. please help?!?
Newsgroup_User Aug 27, 2006 9:28 AM (in response to Newsgroup_User)Yes that works!
Thank you!

Michael Evangelista
Evangelista Design / Evangelista Consulting, inc.
www.evangelistaweb.com
Custom Small Business Website Solutions
"Hal B. Helms" <webforumsuser@macromedia.com> wrote in message news:ecr6or$72k$1@forums.macromedia.com...
> Here's the formula for doing the monthly payment. The APR is going to be
> considerably harder, as it requires iterative approximations.
>
> <cfset loanAmount = 200000 />
> <cfset extraCost = 5000 />
> <cfset interestRate = 7.5/1200 />
> <cfset numberOfMonths = 360 />
>
> <cfset monthlyPayment = ((loanAmount + extraCost) * interestRate * ((1 +
> interestRate)^numberOfMonths)) / (((1 + interestRate)^numberOfMonths)  1) />
>
> <cfoutput>
> #monthlyPayment#
> </cfoutput>
>

5. Re: CF Calculation  so close.. please help?!?
Newsgroup_User Aug 27, 2006 10:02 AM (in response to Newsgroup_User)Ok... back again... you are not kidding about the APR formula, yikes.
I merged your code with another attempt, in the form of a cfscript, and it is working
great to show the monthly payment
<cfscript>
loanAmount = #form.LoanAmount#;
extraCost = #totalClosingCosts#;
interestRateAnnual = #loanRate#;
origIntRate = interestRateAnnual/1200;
loanMonths = #loanTerm#*12;
monthlyPaymentsNum = (loanAmount+extraCost)* origIntRate * ((1+origIntRate)^loanMonths);
monthlyPaymentsDen = ((1+origIntRate)^loanMonths)1;
monthlyPayments = monthlyPaymentsNum / monthlyPaymentsDen;
</cfscript>
But now, I need to find the APR.
Here is one formula that shows it 'in reverse'.. in other words, the equation must be solved to find the missing variable.. and
I have no idea how to do that in CF.
http://www.efunda.com/formulae/finance/loan_calculator.cfm
What I need to do is use 'scenario #2'
Any ideas how to approach that?

Michael Evangelista
Evangelista Design / Evangelista Consulting, inc.
www.evangelistaweb.com
Custom Small Business Website Solutions
"Hal B. Helms" <webforumsuser@macromedia.com> wrote in message news:ecr6or$72k$1@forums.macromedia.com...
> Here's the formula for doing the monthly payment. The APR is going to be
> considerably harder, as it requires iterative approximations.
>
> <cfset loanAmount = 200000 />
> <cfset extraCost = 5000 />
> <cfset interestRate = 7.5/1200 />
> <cfset numberOfMonths = 360 />
>
> <cfset monthlyPayment = ((loanAmount + extraCost) * interestRate * ((1 +
> interestRate)^numberOfMonths)) / (((1 + interestRate)^numberOfMonths)  1) />
>
> <cfoutput>
> #monthlyPayment#
> </cfoutput>
>