I feel stoopid ... this code is to verbose

Matt Gerrans mgerrans at mindspring.com
Sat Jun 15 03:52:37 EDT 2002


> strfmt = lambda x:"".join(map(lambda c,l,y=len(x):(l==3) and c+"," or
> (not (l-3)%3 and c+"." or c),list(x),range(len(x),0,-1)))

Needs a little more tweaking; try this:

strfmt(str(-10000))





More information about the Python-list mailing list