How can I use parseInt for a double?
<p>My program receives some input (a <code>String</code>). It is rather possible that the input is in the form of a <code>double</code>, like <code>"1.5"</code>. But I would like to convert it to an <code>integer</code>, so I can end up with just a <code>1</code>.</p>

<p>First, I tried this:</p>

<pre><code>Integer.parseInt(someString);
</code></pre>

<p>But it doesn't work - I'm assuming it is because of the dot <code>.</code> that it can't parse it.</p>

<p>So I thought that maybe the <code>Integer</code> class can create an <code>integer</code> from a <code>double</code>. So I decided to create a <code>double</code> and then make it an <code>int</code>, like this:</p>

<pre><code>Integer.parseInt(Double.parseDouble(someString));
</code></pre>

<p>But apparently there is </p>

<blockquote>
  <p>no suitable method found for parseInt(double)</p>
</blockquote>

<p>So, what do you suggest? Are there one-liners for this? I thought about making a method that removes the dot and all characters after it... but that doesn't sound very cool.</p>
