title: Avoiding rounding when doing calculation
body: <p>I've a piece of Java code from here which converts a number to words, it's working fine but the fraction is always 1 less than it should be, ex. <code>122.11</code> is printed <code>122.10</code>.</p>
  
  <p>Here is piece of code which is doing the calculation.
  How can I solve this issue?</p>
  
  <pre><code>    String phrase = "122.11" ;
      Float num = new Float( phrase ) ;
      int dollars = (int)Math.floor( num ) ;
      int cent = (int)Math.floor( ( num - dollars ) * 100.0f ) ;
  </code></pre>