# Currency converter - output NaN

**URL:** <https://forum.kirupa.com/t/currency-converter-output-nan/253554>\
**Category:** Uncategorized\
**Created:** [March 3, 2008, 12:52am UTC](https://forum.kirupa.com/t/currency-converter-output-nan/253554 "2008-03-03T00:52:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nukegara](https://avatars.discourse-cdn.com/v4/letter/n/71c47a/32.png) [@nukegara](https://forum.kirupa.com/u/nukegara)\
**Post date:** [March 3, 2008, 12:52am UTC](https://forum.kirupa.com/t/currency-converter-output-nan/253554/1 "2008-03-03T00:52:03Z")

</div>

Hi, I was wondering if anyone could look over this and advise me on why the output would be NaN?

```auto
stop();
 convertToCNY_btn.onRelease = convertToCNY;

    
convertToUSD_btn.onRelease = convertToUSD;
    
    function convertToCNY() {
        trace("convertToCNY clicked");
        var USDtoCNYexchangeRate = Number(7.16);
        var USDinput = Number(USDinput_tf.text);
         trace(USDinput);
        var CNYrate = ( USDinput / USDtoCNYexchangeRate );
        trace(CNYrate);
        trace(USDtoCNYexchangeRate);
        USDconverted_tf.text = CNYrate;
    }

```

I actually have to use xml to get the exchange rate, but I’d figure I’d start off like this to see if it works. Obviously it doesn’t, for reasons beyond me, as it always is XD;
