code: def _formatNumbers(self, line):
          
          # below thousands separator syntax only works for
          # python 2.7, skip for 2.6
          if sys.version_info < (2, 7):
              return line
  
          last_index = 0
          try:
              # find the index of the last } character
              last_index = (line.rindex('}') + 1)
              end = line[last_index:]
          except ValueError:
              return line
          else:
              # split the string on numbers to isolate them
              splitted = re.split("(\d+)", end)
              for index, val in enumerate(splitted):
                  converted = 0
                  try:
                      converted = int(val)
                  # if it's not an int pass and don't change the string
                  except ValueError:
                      pass
                  else:
                      if converted > 1000:
                          splitted[index] = format(converted, ",d")
              return line[:last_index] + ("").join(splitted)
docs: Format the numbers so that there are commas inserted.
  
          For example: 1200300 becomes 1,200,300.