def commafy(s):
    r = []
    for i, c in enumerate(reversed(str(s))):
        if i and (not (i % 3)):
            r.insert(0, ',')
        r.insert(0, c)
    return ''.join(r)
dataset/ETHPy150Open peterbe/django-fancy-cache/example/example/app/views.py/commafy/original