title: Function to convert numbers over 1000 to 1k etc. AS3
body: <p>G'day,</p>
  
  <p>The function is coded, but it's on the stage frame. I'm looking to get it converted into a more dynamic function so I can just call it on all my textfields.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>function numtolet():void
  {
      output.text = String(int(earner  * 100) / 100);
      if (earner &gt;= 1000 &amp;&amp; earner &lt; 1000000)
      {
          output.text = String(int((earner/1000)  * 100) / 100 + "k");
      }
      else if (earner &gt;=1000000 &amp;&amp; earner &lt; 1000000000)
      {
          output.text = String(int((earner/ 1000000) * 100 ) / 100 + " M");
      }
  }
  </code></pre>
  
  <p>I'm looking to turn the 'output.text' portion into a variable that changes based on the text field calling the function and 'earner' to the variable the textfield reads.</p>
  
  <p>Cheers,</p>
  
  <p>-Aidan.</p>