(n)
return result
Receives integer n, returns string representation of n with commas in thousands place.
        I'm sure there's easier ways of doing this... but meh.
Receives integer n, returns string representation of n with commas in thousands place.
        I'm sure there's easier ways of doing this... but meh.
Receives integer n returns string representation of n with commas in thousands place . I m sure there s easier ways of doing this ... but meh .
def add_commas(n):
    """
        Receives integer n, returns string representation of n with commas in thousands place.
        I'm sure there's easier ways of doing this... but meh.
    """
    strn = str(n)
    lenn = len(strn)
    i = 0
    result = ''
    while i < lenn:
        if (lenn - i) % 3 == 0 and i != 0: result += ','
        result += strn[i]
        i += 1
    return result
def add_commas ( n ) : strn = str ( n ) lenn = len ( strn ) i = 0 result = '' while i < lenn : if ( lenn - i ) % 3 == 0 and i != 0 : result += ',' result += strn [ i ] i += 1 return result