Java Double Format to show 2 decimal points even when zero
<p>I want to print out double values onto the screen with 2 decimal points. So far this line has worked perfectly:</p>

<pre><code>System.out.println(new DecimalFormat("$#,###.##").format(value));
</code></pre>

<p>For inputs like:</p>

<pre><code>double value = 82348238482834.23482348;
</code></pre>

<p>It prints out:</p>

<pre><code>$82,348,238,482,834.23
</code></pre>

<p>Which is exactly what I want. However, if I have the input <code>0</code> I want it to print out <code>$0.00</code>. With the above format line it prints out <code>$0</code>. I tried changing the above code to:</p>

<pre><code>double value = 0;
System.out.println(new DecimalFormat("$#,###.00").format(value));
</code></pre>

<p>But that printed out <code>$.00</code>. I could just do this:</p>

<pre><code>if(value == 0) {
    System.out.println("$0.00");
}
</code></pre>

<p>It works but it's very ugly. Is there any other way to solve this issue?</p>