alloydflanagan at comcast.net (A. Lloyd Flanagan) wrote in message Another version of a more compact function would be, def commafy(s): return len(s) > 3 and "%s,%s" % (commafy(s[:-3]), s[-3:]) or s Note that this function accepts string representation of an integer (without checks of course). P Adhia