Commas in a number

Question posted in Computer Software on 12 2011
Rate question difficulty level 0 Votes
Convert a number to a comma delimited number
For example 1000000 should become 1,000,000
 
 
7 Answers
 
newString = string.substring(string.length-3,string.length) // the substring should consider the case that string is shorter then 3 chars
string = string.substring(1,string.length-3)
While(string.length>0)
newstring=string.substring(string.length-3,string.length)+","+newstring
string=string.substring(1,string.length-3)

12/14/2011
 
 
I ltirelaly jumped out of my chair and danced after reading this!

01/11/2012
 
 

01/14/2012
 
 

01/27/2012
 
 
 
 
 
 
 
 
Add an answer*
 
Your name
Email
 

add a question

arrow_blue


Now hiring!
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------