title: CInt does not round Double value consistently - how can I remove the fractional part?
body: <p>I've stumbled upon an issue with <a href="https://msdn.microsoft.com/en-us/library/s2dy91zy.aspx" rel="noreferrer">CInt</a> and converting a double to an integer.</p>
  
  <p>The issue is the following:</p>
  
  <pre><code>CInt(10.5)  'Result is 10
  CInt(10.51) 'Result it 11, but I expected 10...
  </code></pre>
  
  <p>I got used to C# style conversion where <code>(int) 10.51</code> is 10.</p>
  
  <p>As pointed out in the question about <a href="https://stackoverflow.com/questions/423820/integer-parse-vs-cint/423910#423910">Integer.Parse vs CInt</a>, the result is just rounded in some fashion.</p>
  
  <p>However, all I need is to get only integer part and throw away the fractional one. How can I achieve such type of conversion in VB.NET? After some research I see that I can use the <code>Fix()</code> function to do the trick, but is it the best choice?</p>