def fmt_n(n):
    """
    formats an integer
    input: integer
    return: string
    """
    nstr = '%d' % (n)
    nlist = list(nstr)
    for pos in range(len(nstr) - 3, 0, -3):
        nlist.insert(pos, ',')
    return ''.join(nlist)

    formats an integer
    input: integer
    return: string
    
recipes/Python/576380_Prime_look_up_program/recipe-576380.py