title: I need to round a float to two decimal places in Java
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/153724/how-to-round-a-number-to-n-decimal-places-in-java">How to round a number to n decimal places in Java</a>  </p>
  </blockquote>
  
  
  
  <p>I am having difficulties rounding a float to two decimal places.  I have tried a few methods I have seen on here including simply just using <code>Math.round()</code>, but no matter what I do I keep getting unusual numbers.</p>
  
  <p>I have a list of floats that I am processing, the first in the list is displayed as <code>1.2975118E7</code>.  What is the <code>E7</code>?</p>
  
  <p>When I use <code>Math.round(f)</code> (f is the float), I get the exact same number.</p>
  
  <p>I know I am doing something wrong, I just am not sure what.</p>
  
  <p>I just want the numbers to be in the format <code>x.xx</code>.  The first number should be <code>1.30</code>, etc.</p>