I'm working on outputting a graduated payment schedule that increases every 24 months. I'm having some trouble getting the payment value to increment correctly so that payment 2 is the total of the initial payment times the increment. Then, payment 3 is a total of payment 2 times the increment. For example, the first couple of payments should look like this...
Payment 1: $274.22 increase payment $13.64
Payment 2: $287.86 increase payment $15.03
Payment 3: $302.18 increase payment $15.78
Payment 4: $317.22 increase payment $16.57
and so on... The increment is .04975. The initial payment times the increment + the original payment amount becomes the payment 2. Then, the second payment times the increment + payment 2 becomes the third payment. The third payment times the increment + the third payment becomes payment 4, etc...
I was working with a loop, like this...
<cfset loopterm = 360 />
<cfset incr = .04975 />
<cfset gradinital = 274.22 />
<cfloop from="1" to="#( loopterm / 24 )#" index="i">
<cfset newamt = newamt + ( gradinitial * incr ) />
<cfoutput>
#dollarformat( newamt )#
</cfoutput>
</cfloop>
Problem is the increase is always the same amount and does not graduate.
Thank you for any help you can provide.
I think you're close, but you're using the same
gradinitial
value in every calculation, so your increase value is always the same.This produces a result set like this:
It's not perfect, but hopefully that gets you on the right track.