Car payment estimation formula in javascript
<p>The Formula looks like this:</p>

<pre><code>(25000 x (.06 / 12)) / (1 - ((1 + (.06 / 12))^(-36))) = 760.548436
</code></pre>

<p>I have been attempting to convert this to javascript but with not much luck. If you put that above formula into google you will see the answer.</p>

<p>After many attempts and different methods, braking up the formula into different variables then dividing them, I haven't had any luck, when I came up with this, it got me the wrong answer:</p>

<pre><code>var loan = 25000;
var rate = 6 / 100;
var term = 36;
var calculate = (loan * (rate / 12)) / (1 - ((1 + (rate / 12))^(-term)));
console.log(calculate);
</code></pre>

<p>Output was:</p>

<pre><code>3.4722222222222223
</code></pre>

<p>And not 760.548436. Anyone have any ideas?</p>
