code: def comma(value):
      
      try:
          if float(value) == _round(float(value), 0):
              output = "{:,}".format(int(value))
          else:
              output = "{:,}".format(float(value))
      except Exception:
          output = text_type(value)
  
      return output
docs: FORMAT WITH THOUSANDS COMMA (,) SEPARATOR