quick question, I have some integrate variable in javascript, say: 123456, or 123456789, it can be any valid number. Now, I would like to convert the number to a string like “123,456” or “123,456,789”. Does anyone have a good algorithm for this? Of course, it should work for any numbers. For example: for 2000 —> 2,000; 123456—>123,456
quick question, I have some integrate variable in javascript, say: 123456, or 123456789, it
Share
Give this a shot.