Display as two Decimal
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8779659/convert-a-number-to-2-decimal-places-in-java">Convert a number to 2 decimal places in Java</a>  </p>
</blockquote>



<p>I need to display a decimal number up to two digits in Java.</p>

<p>For example:</p>

<pre><code>Case1.   2.333 - 2.33
Case2.   3.4 -   3.40
</code></pre>

<p>I am able to do the first case. Can anybody help me how to do for the second case.</p>
