title: Javascript format a number asin C#
body: <p>I have a number which currently is 1,657,108,700 and growing. However I wish for it to show as 
  1,657,108k</p>
  
  <p>Does javascript or html have a build in function to do this? </p>
  
  <p>The value is being set throu javascript to a span field in html.</p>
  
  <p><strong>[edit]</strong></p>
  
  <p>From the comment I got my method as far as: </p>
  
  <pre><code>var start = '1,657,108,700';                
  start = (start / 1000).toFixed(0);                                      
  var finish = '';
  while (start.length &gt; 3)
  {       
      finish = ','.concat(start.substring(start.length - 3, 3), finish);      
      start = start.substring(0, start.length - 3);
  };
  finish = start + finish + "k";
  return finish;
  </code></pre>
  
  <p>however this returns 1,65,7k instead of 1,657,108k.. anyone know why?</p>