I feel stoopid ... this code is to verbose

Matt Gerrans mgerrans at mindspring.com
Sat Jun 15 09:52:37 CEST 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