# Loan Calculator

**URL:** <https://forum.kirupa.com/t/loan-calculator/318142>\
**Category:** flash\
**Created:** [January 11, 2011, 3:28pm UTC](https://forum.kirupa.com/t/loan-calculator/318142 "2011-01-11T15:28:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![s6xspeed](https://avatars.discourse-cdn.com/v4/letter/s/858c86/32.png) [@s6xspeed](https://forum.kirupa.com/u/s6xspeed)\
**Post date:** [January 11, 2011, 3:28pm UTC](https://forum.kirupa.com/t/loan-calculator/318142/1 "2011-01-11T15:28:19Z")

</div>

Hi all,

i’m trying to create a loan calculator and i have things going but i get a NaN result when i hit the calculate button

3 textboxes:

amount  
term  
interest  
total is displayed

on (release)  
{  
var p:Number = parseInt(amount.text);  
var n:Number = parseInt(term.text) \* 12;  
var r:Number = parseInt(interest.text) / 100;  
var a:Number = (p \* r \* Math.pow(1 + r, n)) / (Math.pow(1 + r, n) - 1);

```
 total.text = Math.round(a*100)/100;

```

}

can anyone help me shed some light?
