title: Formatting a number with correct decimal scale
body: <p>I need to format a number with scale of 2 decimal places. The original number may be a whole number or a number with three decimal places. However the result should be formatted to have commas and also two decimal places always regardless of whether the original number is whole number or having decimal places.</p>
  
  <ol>
  <li>When original num  = 56565656.342 ==> I need 56,565,656.34</li>
  <li>When original num  = 56565656 ==> I need 56,565,656.00</li>
  <li>When original num  = 56565656.7 ==> I need 56,565,656.70</li>
  </ol>
  
  <p>I am using the following code which is formatting the code but its failing to add the two decimal places in the above 2 &amp; 3 cases.</p>
  
  <pre><code>String originalNumber = "56565656.7";
  BigDecimal b = new BigDecimal(originalNumber).setScale(2, BigDecimal.ROUND_HALF_UP);
  String formattedNumber = NumberFormat.getInstance().format(b);
  </code></pre>
  
  <p>Please let me know if there is any way to accomplish this in efficeint way.</p>
  
  <p>Thanks in advance.</p>