Car Leasing Calculation - what is the formula in JavaScript?

			// Car Leasing Calculation  -  what is the formula in JavaScript???
			var amount = parseInt($('input[name="amount"]').val());	
			var downpayment = parseInt($('input[name="downpayment"]').val());	
			var interest = parseInt($('input[name="interest"]').val());	
			var months = parseInt($("#months").val());  // 6, 12, 18, 24, 30, 36, 48
			
			var result = ..... formula for monthly payment and number of months?

The amount you’re charged is a combination of the depreciation fee and the finance fee.

The depreciation fee has a formula of:
Depreciation Fee = (Net Cap. Cost - Residual Value)/Months

As you don’t seem to have any residual value for the vehicle, I can assume that the car will not be returning and thus has a residual value of 0.

The finance fee is applied to the depreciation fee where the money factor can be worked out from the annual percentage rate:
Finance Fee = (Net Cap. Cost + Residual Value) * (APR / 2400)

In regard to your code, this would be:

var depreciationFee = (amount - downpayment) / months;
var financeFee = (amount + downpayment) * (interest / 2400);
var result = depreciationFee + financeFee;

Further details can be found at the annual percentage rate wiki page.

Why the division by 2400…?

Because you’re getting the average (/2) over 12 months (/12) of the percentage (/100)
Multiply those all together and you get 2400, which is what everyone in the industry uses.

Or, they simplify it down to just the money factor, such as 0.0030, which is equivalent to an APR of 7.2%

Here’s the math - http://www.efunda.com/formulae/finance/moneyfactor.cfm

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.