• Support PF! Buy your school textbooks, materials and every day products Here!

What is the car leasing calculation formula

  • #1

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
???
 

Answers and Replies

  • #2
billy_joule
Science Advisor
1,200
330
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?
 
  • #3
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....
 
  • #4
billy_joule
Science Advisor
1,200
330
  • #5
actually I am web developer and need this for a car dealer site... is Not homework for school....
 
  • #6
33,276
4,985
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.
 
  • #7
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728

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.
 
  • #8
var depreciationFee = (amount - downpayment) / months;
var financeFee = (amount + downpayment) * (interest / 2400);
var result = depreciationFee + financeFee;
 
  • #9
33,276
4,985
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:
  • #11
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,...?
 
  • #12
well
 
  • #13
33,276
4,985
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?
 
  • #14
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...?
 
  • #15
billy_joule
Science Advisor
1,200
330
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
 
  • #17
billy_joule
Science Advisor
1,200
330
https://www.sitepoint.com/community/t/car-leasing-calculation-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?
 
  • #18
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??
 

Related Threads on What is the car leasing calculation formula

Replies
25
Views
6K
Replies
1
Views
1K
Replies
6
Views
3K
  • Last Post
Replies
4
Views
1K
Replies
2
Views
4K
Replies
2
Views
2K
Replies
3
Views
1K
Top