title: Convert float to integer in Python - invalid literal error
body: <p>How do I convert this number to an integer I can do simple math with?!
  (eg. 10.5200 below.)</p>
  
  <pre><code>{"bid":["10.52000000","0.70824000"],"ask":["10.54000000","2.07336000"],"seq":2456916}
  </code></pre>
  
  <p>I get the following error, and it's driving me mental:</p>
  
  <pre><code>ValueError: invalid literal for int() with base 10: '10.52'
  </code></pre>
  
  <p>This is what I'm running:</p>
  
  <pre><code>bitfl = json.loads(bitfl)
  bid = bitfl['bid']
  ask = bitfl['ask']
  bidd = bid[0] #edit - this is actually in, as it's a list
  askk = ask[0]
  print('diff: %i' % (int(bidd[0]) - int(askk[0])))
  </code></pre>
  
  <p>I don't know WHY it should be so difficult to just accept "10.52" as a string or float or unicode and just convert it to a normal, calculable integer!</p>
  
  <p>Any help MUCH appreciated!</p>