Best way to Format a Double value to 2 Decimal places
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2808535/round-a-double-to-2-significant-figures-after-decimal-point">Round a double to 2 significant figures after decimal point</a>  </p>
</blockquote>



<p>I am dealing with lot of double values in my application, is there is any easy way to handle the formatting of decimal values in Java?</p>

<p>Is there any other better way of doing it than </p>

<pre><code> DecimalFormat df = new DecimalFormat("#.##");
</code></pre>

<p>What i want to do basically is format double values like </p>

<pre><code>23.59004  to 23.59

35.7  to 35.70

3.0 to 3.00

9 to 9.00
</code></pre>
