Java : how do I get the part after the decimal point?
<p>I have a <code>double</code> variable <code>d = 1.15</code>.</p>

<p>I want the number after the decimal point, i.e. "15".</p>

<p>What is best way to achieve this in Java?</p>

<p>I have tried like this:<br></p>

<pre><code>Double d = 1.15;
String str = d.toString();
int len = str.substring(str.indexOf(".")).length() - 1;
int i= (int) (d * (long)Math.pow(10,len) % (long)Math.pow(10,len));
</code></pre>

<p>But i didn't get the proper answer because when I convert <code>d.toString()</code> the answer is <code>14.999999999999986</code>.</p>

<p>Please help. Thanks.</p>
