title: Converting Numbers into Words
body: <p>I have taken this code from Stackoverflow and modified it, but i am unable to convert number for more than 3 digits.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>var num = this.rawValue;
  var a = ['','one ','two ','three ','four ', 'five ','six ','seven ','eight ','nine ','ten ','eleven ','twelve ', 'thirteen  ','fourteen ','fifteen ','sixteen ','seventeen ','eighteen ','nineteen '];
  var b = ['', '', 'twenty','thirty','forty','fifty', 'sixty','seventy','eighty','ninety'];
  var c = ['thousand', 'million', ''];
  
  num = num.toString();
  
  num = ( '000000000' + num ).substr( -9 ); // // Make number into a predictiable nine character string
  num = num.match( /.{3}/g ); // Split string into chuncks of three numbers then reverse order of returned array
  
  var words = '';
  
  for( var i = 0; i &lt; c.length; i++ ) {
  
      var n = num[i];
      var str = '';
      str += ( words != '' ) ? ' ' + c[i] + ' ' : '';
      str += ( n[0] != 0 ) ? ( a[Number( n[0] )] + 'hundred ' ) : '';
      n = n.substr( 1 );
      str += ( n != 0 ) ? ( ( str != '' ) ? 'and ' : '' ) + ( a[Number( n )] || b[n[0]] + ' ' + a[n[1]] ) : '';
      words += str;
  
  }
  
  data.Text.TextField1.rawValue= words;
  </code></pre>
  
  <p>I want to convert number into words for more than 3 digits and to also consider decimal values.</p>
  
  <p>The current code converts up to thousand and it interprets values before decimal point as undefined. The above code was used in javascript under adobe form (sap).</p>