title: Show only decimals of float
body: <p>I need to print a <code>float</code> showing only the <strong>decimals</strong> of that float. For example:</p>
  
  <pre><code>1.23456 --&gt; 23456
  12.3456 --&gt; 3456
  123.456 --&gt; 456
  </code></pre>
  
  <p>I've found the following solution:</p>
  
  <pre><code>float floatValue = 1.23455f;
  String stringValue = Float.toString(floatValue);
  int pointIndex = stringValue.indexOf(".");
  String decimals = stringValue.substring(pointIndex + 1, stringValue.length() - 1);
  </code></pre>
  
  <p>But I think it's a little dirty and I wonder if there is any other standard way, using <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#format%28java.lang.String,%20java.lang.Object...%29" rel="nofollow">String.format</a> or something similar. I did't find anything in the documentation. Thanks in advance!</p>