Java Double get all Digits after dot/comma
<p>it´s a simple task but i´m not able to solve it on my own..</p>

<p>i got </p>

<pre><code>    double digit1 = 12.1;
    double digit2 = 12.99;
</code></pre>

<p>and need a method which gives me this:</p>

<pre><code>    anyMethod(digit1); //returns 10
    anyMethod(digit2); //returns 99
</code></pre>

<p>what i have is</p>

<pre><code>public static void getAfterComma(double digit) {

    BigDecimal bd = new BigDecimal(( digit - Math.floor( digit )) * 100 );
    bd = bd.setScale(4,RoundingMode.HALF_DOWN);
    System.out.println(bd.toBigInteger()); // prints digit1=1 and digit2=99

} 
</code></pre>

<p>anyway i prefer integer as the returntype..
anybody got a quick solution/tip?</p>

<p>kindly</p>
