Posted By

visualadvance on 08/02/11


Tagged


Versions (?)

AS3: Commas in Number


 / Published in: ActionScript 3
 

Adds commas every 3 spaces.

  1. String (1000000).replace(/(\d)(?=(\d\d\d)+$)/g, "$1,");

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: Selfdefiant on June 7, 2012

I looked for almost an hour for this! All that I could find were long functions that didn't work, this worked immediately, thanks!

You need to login to post a comment.