# String to Number Problem

**URL:** <https://forum.kirupa.com/t/string-to-number-problem/173362>\
**Category:** flash\
**Created:** [December 23, 2005, 11:05pm UTC](https://forum.kirupa.com/t/string-to-number-problem/173362 "2005-12-23T23:05:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eyetouch](https://avatars.discourse-cdn.com/v4/letter/e/3ab097/32.png) [@eyetouch](https://forum.kirupa.com/u/eyetouch)\
**Post date:** [December 23, 2005, 11:05pm UTC](https://forum.kirupa.com/t/string-to-number-problem/173362/1 "2005-12-23T23:05:43Z")

</div>

I have a textfield problem. I created a textfield (for input) and wanted to make some calculations using entered numbers. But it recognizes the inputs as a string. For example;

listen=new Object();  
listen.onKeyDown=function(){  
if(Key.isDown(Key.ENTER)){

```
    trace(i+3); // i is the variable of textfield
    
}

```

}  
Key.addListener(listen);

For the program above, if I enter 12 in the textfield and press Enter, result is 123, not 15. How can i make it to recognize input as a number?

Thanks…
