def format_number(n):
    ar = list(str(n))
    for i in range(len(ar))[::-3][1:]:
        ar.insert(i + 1, ',')
    return ''.join(ar)
>>> format_number(1000)
dataset/ETHPy150Open ngsutils/ngsutils/ngsutils/support/ngs_utils.py/format_number