title: Python3: unsupported operand type(s) for +: 'float' and 'str'
body: <p>I'm tryin to add commas to big numbers in my code. When I isolate the code it works:</p>
  
  <pre><code>num = str(12354343)
  print("{:,}".format(float(num)))
  </code></pre>
  
  <p>But inside my code I receive the error unsupported operand type(s) for +: 'float' and 'str'.</p>
  
  <pre><code>def commafy(x):
      x = "{:,}".format(float(x))
      return x
  
  i=1
  
  d = resp.json()
  for result in d['results']:
      #print(result['campaign_name'])
      data[i] = {'Source': 'Taboola', 'Campaign': result['campaign_name'], 'Impr.': commafy(result['impressions']), 'CTR': round(result['ctr'],2) + "%", 'Spent': result['spent']}
      i+=1
  </code></pre>
  
  <p>What is wrong here?</p>
  
  <p>Thank you,</p>