I have actually written all of these funtions for AS2 and AS3 that are in the excel financial section. Let me know if you need any help.
http://www.t8financial.com/ Check out the calculators section. // Determine the periocic payment it takes to pay off a loan (i.e., amortize the loan). // Or calculate how much money you can withdraw from a retirement annuity. // Returns the same value as Microsoft Excel's Insert->Function->Financial->PMT formula, // except the result is of the opposite sign, the future value (remaining balance) is // assumed to be 0, and the payment is assumed to be made at end of each period. // That is, it is equivalent to an Excel command of the form: PMT(Rate, n, -PV, 0, 0) // if type is '0' then it means Payment is made at the end of the period // if type is '1' then it means Payment is made at the beginning of the period public static function PMT (Rate:Number, Nper:Number, PV:Number, FV:Number, Type:Number):Number { // Rate = periodic interest rate // Nper = number of payment periods // PV = initial savings deposit or loan amount (present value) // Calculate the periodic payment needed to amortize (pay back) a loan. var multiplier:Number = Math.pow((1 + Rate), Nper); //return ((PV * Rate * multiplier)/(multiplier - 1)); if(Rate == 0) { return(PV/Nper); } else { return (Rate *((PV * multiplier) + FV)/ (((Rate*Type)+1)*(multiplier - 1))); } } -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Klasson Sent: Friday, January 19, 2007 2:33 AM To: [email protected] Subject: [Flashcoders] PMT calculation problem Hi Flashcoders, I got a problem which I am in no way to figure out myself, but someone here probably has a solution. I found this function when I googled: function Pmt(r, np, pv, fv) { r = r/1200; pmt = -(r*(fv+Math.pow(1+r, np)*pv)/(-1+Math.pow(1+r, np))) return(pmt); } trace( Math.round(Pmt(5, 36, -273168.6, 190300)) ); BUT, the problem is that this "PMT"-function, which am used in programs like Excel, .Net and so on, also have a fifth paramater in which you can send in 0 or 1. The function above behaves like sending in "0" as the fifth parameter -as in as the loan is paid of the last day in the month. But I need to send in "1", and get the result of when the loan is being paid off the first every month. the code above traces out "3277", and that is correct if I wanted it to be when the loan is being paid of the last day in every month, but I really need it to calculate the monthly payment as occuring the last day of every month. So I really want it to be 3263 ;) Do you know how the line of code can be altered so it suits me? Here is a description of the "standard" PMT, how it works: http://www.techonthenet.com/excel/formulas/pmt.php Thanks, Martin _______________________________________________ [email protected] 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 _______________________________________________ [email protected] 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

