显示财务支付估算员

I am attempting to add a estimated payment on my website, getting stuck on the interest amount. Here's what I'd like to do:

(These will vary based on the year of the car, here for demonstration purposes)

$asking = 16495;
$down = 2474;
$doc = 200;
$interest = .05;
$tax = .0635;
$term = 60;

Basically what I'm trying to do is:

$asking  + $doc x $tax - $down x $interest / $term

In my finance calculator the payment comes out to $288.37. On my site the payment is over $7000.

What am I not seeing?

  $asking = '$'.number_format($row['asking']);
  $down_amount = $row['asking'] * .15;
  $rate = .05;
  $term = 60;
  $loan_amount = ($row['asking'] * 6.35 ) - $down_amount;
  $payment_amount = $loan_amount / $term * $rate;

You need parentheses to indicate the order of operation.

I am not 100% sure this is the order you want, but it should be close.

(($asking  + $doc) x $tax - $down) x $interest / $term

Remember the computer will do division and multiplication first, and then do addition and subtraction, unless you specify your own order with parentheses.

Also,

$loan_amount = ($row['asking'] * 6.35 ) - $down_amount;

Should probably be

($row['asking'] * 1.0635 )

if that is supposed to be 6.35%.

Four things:

  1. Order of operations and parentheses -- using your formula without any parentheses, you won't get the right answer.

  2. The annual interest rate needs to be divided by the number of payments per year.

  3. You will want to figure out the size of payments to amortize the loan to zero after 60 payments. Auto loans usually use actual/365 accrual. VERY IMPORTANTLY,

  4. Due to the Truth-in-Lending Act and Regulation Z, you need to be careful to have an adequate disclaimer.