title: Converting SQL FLOAT to SQL INT, lost data
body: <p>I'm having some problems with converting some data stored in a FLOAT datatype to data stored in an INT datatype. The below example illustrates my problem:</p>
  
  <pre><code>DECLARE @data TABLE
  (
   id INT,
   weight FLOAT
  )
  INSERT INTO @data VALUES(1,0.015662)
  
  SELECT CAST(weight * 1000000 AS INT) FROM @data
  SELECT 0.015662 * 1000000
  SELECT CAST(0.015662 * 1000000 AS INT)
  </code></pre>
  
  <p>The desired results would be: <code>ID = 1 VALUE = 15662</code>
  However when coming from the <code>@data</code> table, I don't seem to get this. I instead get <code>ID = 1 VALUE = 15661.</code></p>
  
  <p>Does anyone have any idea why this is? I'm guessing it's some sort of float nuance. But I never thought it would have a problem with something like the above. Any ideas? Thanks in advance for your help.</p>