DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Adding Commas To Digits
Copy from Marek Baczynski's code here http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/439357
def group(n, sep = ','): s = str(n)[::-1] groups =  i = 0 while i < len(s): groups.append(s[i:i+3]) i += 3 return sep.join(groups)[::-1] #>>> group(42424242) #'42,424,242'