# What is the car leasing calculation formula

lsepolis123f

## Homework Statement

// given 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());

## Homework Equations

What is the car leasing calculation formula - what must be...? given above... I have to do in JavaScript... but Not know the formula...

## The Attempt at a Solution

end result:
1. months to finish
2. pay per month amount
???

Lease? Looks like a hire purchase plan, not a lease.

Do you understand what the variables represent? Have you learnt about compounding interest? If not, what research have you done? What specifically don't you understand?

lsepolis123f
I just find formulas online but difficult to bring in my case....

Can you tell formula ... suppose 4 vars are in series A, B, C, D....

lsepolis123f
actually I am web developer and need this for a car dealer site... is Not homework for school....

Mentor
I just find formulas online but difficult to bring in my case....
Show us a couple of the formulas you have found.

Whether this is homework or not, we expect you to put in at least some effort here.

Homework Helper
Dearly Missed

## Homework Statement

// given 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());

## Homework Equations

What is the car leasing calculation formula - what must be...? given above... I have to do in JavaScript... but Not know the formula...

## The Attempt at a Solution

end result:
1. months to finish
2. pay per month amount
???

If you are GIVEN A (the amount), D the (downpayment), r (the interest rate) and n (the number of months), surely you cannot be asking for (1) months to finish; is that not just n itself, or is there some type of no-payment grace period? As for (2): Google is your friend. The necessary formulas are widely available on-line.

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

Mentor
var depreciationFee = (amount - downpayment) / months;
var financeFee = (amount + downpayment) * (interest / 2400);
var result = depreciationFee + financeFee;
Let's look at some numbers, as hypothetical input values using the variables you have in post #1.
Let:
amount = $10,000 downpayment =$2,000
interest = 10 (%)
months = 36

With the variables you have above, you have depreciationFee would be set to (10,000 - 2,000)/36, or $222.22. This would be the amount financed (10,000 - 2,000) divided by the time in months. For financeFee, part of the calculation is amount + downpayment, or 10,000 + 2,000 = 12,000. It's not reasonable to charge interest on what they have already paid -- the down payment. In the other part, you have interest/2400. What is the significance of 2400? Are you assuming that the contract length is 24 months? If so, why are you taking months as an input value? Assuming for the moment that all lease contracts are for 24 months, the calculation for financeFee might be var financeFee = (amount - downpayment) * (interest/2400); but this isn't how banks and credit card companies do things, and I don't think car leasing agencies do it this way, either. The problem is that you are calculating the monthly interest rate based on the first payment, the time when the interest is highest. As the finance amount is paid down, the amount of interest is reduced, but your formula isn't taking that into account. Here's a link to the formula that you should probably be using: https://en.wikipedia.org/wiki/Amortization_calculator#The_formula Last edited: lsepolis123f amount: 11500, downpayment: 1500, interest: 0.07, months: 12, monthly payment = 1259.02 detail.html:871 amount: 11500, downpayment: 1500, interest: 0.07, months: 24, monthly payment = 871.89 detail.html:871 amount: 11500, downpayment: 1500, interest: 0.05, months: 36, monthly payment = 604.34 this is getting in my browser console testing - is it correct,...? lsepolis123f well Mentor amount: 11500, downpayment: 1500, interest: 0.07, months: 12, monthly payment = 1259.02 detail.html:871 amount: 11500, downpayment: 1500, interest: 0.07, months: 24, monthly payment = 871.89 detail.html:871 amount: 11500, downpayment: 1500, interest: 0.05, months: 36, monthly payment = 604.34 this is getting in my browser console testing - is it correct,...? You have the formulas from the link above, as well as from the page that is linked to in that page. Using a calculator, do you get the same results that you show here? lsepolis123f result are correct... not check with calculator but seems will be the same... can you check last one only result...? anyway this numbers seems OK upper 12 months...? Science Advisor amount: 11500, downpayment: 1500, interest: 0.07, months: 12, monthly payment = 1259.02 this is getting in my browser console testing - is it correct,...? Nope, however you're calculating your interest is way off, paying back over$15k ($1259.02 * 12) for a one year loan of$10,000 ($11,500 -$1,500) is over 50%, interest, not 7%.

Also, It looks like you're calculating a hire purchase plan, not a lease. To calculate lease payments you need information on the value of the car when the lessee returns the car to the leaser.
https://en.wikipedia.org/wiki/Vehicle_leasing

https://www.sitepoint.com/community...tion-what-is-the-formula-in-javascript/227906

This here ^^^ is correct?? is this>>>>
var depreciationFee = (amount - downpayment) / months;
var financeFee = (amount + downpayment) * (interest / 2400);
var result = depreciationFee + financeFee;

As post #9 has already explained, this is not correct.
It seems like you don't understand how a lease works or what your variables represent. Success is very unlikely if you aren't willing to do some research and study.
Can you answer the questions in post #2?

lsepolis123f
As post #9 has already explained, this is not correct.
It seems like you don't understand how a lease works or what your variables represent. Success is very unlikely if you aren't willing to do some research and study.
Can you answer the questions in post #2?

sitepoint forum say IS CORRECT... I am web developer i know little about this can you tell correct formula to finish??