title: Rounding Bigdecimal values with 2 Decimal Places
body: <p>I want a function to convert <em>Bigdecimal</em> <code>10.12 for 10.12345</code> and <code>10.13 for 10.12556</code>.
  But no function is satisfying both conversion in same time.Please help to achieve this.</p>
  
  <p>Below is what I tried.<br>
  With value 10.12345:</p>
  
  <pre><code>BigDecimal a = new BigDecimal("10.12345");
  
  a.setScale(2, BigDecimal.ROUND_UP)
  a.setScale(2, BigDecimal.ROUND_CEILING)
  a.setScale(2, BigDecimal.ROUND_DOWN)
  a.setScale(2, BigDecimal.ROUND_FLOOR)
  a.setScale(2, BigDecimal.ROUND_HALF_DOWN)
  a.setScale(2, BigDecimal.ROUND_HALF_EVEN)
  a.setScale(2, BigDecimal.ROUND_HALF_UP)
  </code></pre>
  
  <p>Output :</p>
  
  <pre><code>10.12345::10.13
  10.12345::10.13
  10.12345::10.12
  10.12345::10.12
  10.12345::10.12
  10.12345::10.12
  10.12345::10.12
  </code></pre>
  
  <p>With value 10.12556:</p>
  
  <pre><code>BigDecimal b = new BigDecimal("10.12556");
  
  b.setScale(2, BigDecimal.ROUND_UP)
  b.setScale(2, BigDecimal.ROUND_CEILING)
  b.setScale(2, BigDecimal.ROUND_DOWN)
  b.setScale(2, BigDecimal.ROUND_FLOOR)
  b.setScale(2, BigDecimal.ROUND_HALF_DOWN)
  b.setScale(2, BigDecimal.ROUND_HALF_EVEN)
  b.setScale(2, BigDecimal.ROUND_HALF_UP)
  </code></pre>
  
  <p>Output :</p>
  
  <pre><code>10.12556::10.13
  10.12556::10.13
  10.12556::10.12
  10.12556::10.12
  10.12556::10.12
  10.12556::10.12
  10.12556::10.12
  </code></pre>