Re: [Flashcoders] Compound interest formula
Sorry, on second thought, it's quite different. With amortization, you have a longer period with a larger amount, with saving, a longer period with a smaller amount. So the compound interest changes the picture entirely. But maybe the derivation of the formula is of some help. Mark On 9/15/07, Mark Winterhalder [EMAIL PROTECTED] wrote: Hello Kerry, On 9/15/07, Kerry Thompson [EMAIL PROTECTED] wrote: I'm ok with math, but it's not my strong suite. Does somebody have the compound interest formula, preferably in AS2 form? It comes in various forms. The one I need is, given an interest rate, a period of time, and an end goal, what monthly payments do you need to make. In other words, assuming 8% annual return, and you want $1,000,000 in 25 years, how much do you need to set aside each month? Isn't this the same as amortization of debt? http://en.wikipedia.org/wiki/Amortization_calculator But please don't rely on me with this. Double check with existing examples, and be careful about how interest is payed (monthly? yearly? quarterly?). All I'm saying is, the formula /should/ be (roughly) identical. Best give it a shot, fill in your own numbers, and then ask your bank and see if they come up with the same result. It might be a month off, or a month's worth of interest, or I might be completely wrong... Mark ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Compound interest formula
Hello Kerry, On 9/15/07, Kerry Thompson [EMAIL PROTECTED] wrote: I'm ok with math, but it's not my strong suite. Does somebody have the compound interest formula, preferably in AS2 form? It comes in various forms. The one I need is, given an interest rate, a period of time, and an end goal, what monthly payments do you need to make. In other words, assuming 8% annual return, and you want $1,000,000 in 25 years, how much do you need to set aside each month? Isn't this the same as amortization of debt? http://en.wikipedia.org/wiki/Amortization_calculator But please don't rely on me with this. Double check with existing examples, and be careful about how interest is payed (monthly? yearly? quarterly?). All I'm saying is, the formula /should/ be (roughly) identical. Best give it a shot, fill in your own numbers, and then ask your bank and see if they come up with the same result. It might be a month off, or a month's worth of interest, or I might be completely wrong... Mark ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
Re: [Flashcoders] Compound interest formula
- Original Message - From: Kerry Thompson [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Saturday, September 15, 2007 7:48 AM Subject: [Flashcoders] Compound interest formula I'm ok with math, but it's not my strong suite. Does somebody have the compound interest formula, preferably in AS2 form? It comes in various forms. The one I need is, given an interest rate, a period of time, and an end goal, what monthly payments do you need to make. In other words, assuming 8% annual return, and you want $1,000,000 in 25 years, how much do you need to set aside each month? Here it is in Lingo (from my book - sorry some line breaks have come in, I'm on a computer with no Director so I had to cut and paste from the documentation). The second function is the one you're looking for (but it calls the first one). Danny on mortgage am, pc, pay, tp --! ARGUMENTS: am (loan amount), pc (APR), pay (monthly payment), --! tp (#monthly, #mixed or #yearly (default), the detail required for output) --! RETURNS: a string giving the rate of repayment on a (capital and repayment) mortgage set the floatprecision to 2 -- (ensures two decimal place output) -- set the monthly interest, as a fraction 1+APR/1200 pc=1+pc/(1200.0) i=0 oldam=am ret= repeat while am0 i=i+1 -- each month, increase the loan by the monthly interest, and decrease it by the fixed payment am=pc*am - pay if am=0 then -- if the amount is less than or equal to zero then the loan has been repayed put At the end of monthithe loan is $0return after ret -- we can also calculate the total money paid in interest put You have paid $(i*pay-oldam+am)in interest. after ret am=0 else if (i mod 12) = 0 then tx=yeari/12 else tx=monthi if tp=#monthly or (tp=#mixed and i12) or ((i mod 12) =0) then put At the end oftxthe loan is $amreturn after ret end if end if end repeat return ret end on mortgagecalc am, pc, yr --! ARGUMENTS: am (loan amount), pc (APR), yr (number of years), --! RETURNS: a string giving the monthly payment for a (capital and repayment) mortgage at the given APR i = 1+pc/1200.0 mth=yr*12 pow=power(i,mth) pay=am*pow*(i-1)/(pow-1) put Monthly payment ispay mortgage(am,pc,pay,#year) end ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Compound interest formula
Thanks, Danny. I should be able to convert it to ActionScript. Cordially, Kerry Thompson Here it is in Lingo (from my book - sorry some line breaks have come in, I'm on a computer with no Director so I had to cut and paste from the documentation). The second function is the one you're looking for (but it calls the first one). Danny on mortgage am, pc, pay, tp --! ARGUMENTS: am (loan amount), pc (APR), pay (monthly payment), --! tp (#monthly, #mixed or #yearly (default), the detail required for output) --! RETURNS: a string giving the rate of repayment on a (capital and repayment) mortgage set the floatprecision to 2 -- (ensures two decimal place output) -- set the monthly interest, as a fraction 1+APR/1200 pc=1+pc/(1200.0) i=0 oldam=am ret= repeat while am0 i=i+1 -- each month, increase the loan by the monthly interest, and decrease it by the fixed payment am=pc*am - pay if am=0 then -- if the amount is less than or equal to zero then the loan has been repayed put At the end of monthithe loan is $0return after ret -- we can also calculate the total money paid in interest put You have paid $(i*pay-oldam+am)in interest. after ret am=0 else if (i mod 12) = 0 then tx=yeari/12 else tx=monthi if tp=#monthly or (tp=#mixed and i12) or ((i mod 12) =0) then put At the end oftxthe loan is $amreturn after ret end if end if end repeat return ret end on mortgagecalc am, pc, yr --! ARGUMENTS: am (loan amount), pc (APR), yr (number of years), --! RETURNS: a string giving the monthly payment for a (capital and repayment) mortgage at the given APR i = 1+pc/1200.0 mth=yr*12 pow=power(i,mth) pay=am*pow*(i-1)/(pow-1) put Monthly payment ispay mortgage(am,pc,pay,#year) end ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
RE: [Flashcoders] Compound interest formula
Mark Winterhalder wrote: I wrote: In other words, assuming 8% annual return, and you want $1,000,000 in 25 years, how much do you need to set aside each month? Isn't this the same as amortization of debt? http://en.wikipedia.org/wiki/Amortization_calculator Not quite the same. Amortization of debt is a little different from an annuity. You're decreasing the debt by your payment, minus the interest the bank charges you. As the principal gets smaller, a larger amount of your payment goes to paying the principal. I think you pointed me in the right direction, though. I found a set of formulas in Wikipedia under Time value of money. I think this is the one I want: http://en.wikipedia.org/wiki/Time_value_of_money#Example_5:_Calculate_the_v alue_of_a_regular_savings_deposit_in_the_future. I'll convert that to ActionScript and post it for the archives. Cordially, Kerry Thompson ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
[Flashcoders] Compound interest formula
I'm ok with math, but it's not my strong suite. Does somebody have the compound interest formula, preferably in AS2 form? It comes in various forms. The one I need is, given an interest rate, a period of time, and an end goal, what monthly payments do you need to make. In other words, assuming 8% annual return, and you want $1,000,000 in 25 years, how much do you need to set aside each month? TIA. Cordially, Kerry Thompson ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com