(self, digitstr)
return b','.join(chunks)
Insert commas to group digits in a decimal number.
Insert commas to group digits in a decimal number.
Insert commas to group digits in a decimal number .
def _group_digits(self, digitstr):
        """Insert commas to group digits in a decimal number."""
        first = len(digitstr) % 3
        chunks = [digitstr[i:i + 3] for i in range(first, len(digitstr), 3)]
        if first:
            chunks = [digitstr[:first]] + chunks
        return b','.join(chunks)
def _group_digits ( self , digitstr ) : first = len ( digitstr ) % 3 chunks = [ digitstr [ i : i + 3 ] for i in range ( first , len ( digitstr ) , 3 ) ] if first : chunks = [ digitstr [ : first ] ] + chunks return b',' . join ( chunks )