title: How to round double to nearest whole number and return it as Integer
body: <p>Let suppose that I have <code>double x</code>. I would return nearest whole number of <code>x</code>. For example:</p>
  
  <ol>
  <li>if <code>x = 6.001</code> I would return <code>6</code></li>
  <li>if <code>x = 5.999</code>  I would return <code>6</code></li>
  </ol>
  
  <p>I suppose that I should use <code>Math.ceil</code> and <code>Math.floor</code> functions. But I don't know how return nearest whole number...</p>