Java Decimals formatting
<p>How to number formating with Java in various scenarios:</p>

<ol>
<li>if the value is 0,then output will be zero.</li>
<li>if the value 1,then output will be 1.</li>
<li>if the value is 1.2,then output will be 1.20.</li>
<li>if the value is 1.20,then output will be 1.20.</li>
</ol>

<p>So it means if the input value has decimals then i have to apply numberformat to two decimal places otherwise not required.</p>
