title: Java : Removing zeros after decimal point in BigDecimal
body: <p>I have a program like this ,</p>
  
  <pre><code>BigDecimal bd = new BigDecimal(23.086);
  BigDecimal bd1= new BigDecimal(0.000);
  
  bd = bd.setScale(2, RoundingMode.HALF_UP).stripTrailingZeros();
  bd1 = bd1.setScale(2, RoundingMode.HALF_UP).stripTrailingZeros();
  
  System.out.println("bd value::"+ bd);
  System.out.println("bd1 value::"+ bd1);
  </code></pre>
  
  <p>I get the following output: <code>23.09</code> for <code>bd</code> and 0.00 for <code>bd1</code>, but I want <code>bd1</code> as <code>0</code> not as <code>0.00</code>. Am I applying the methods correctly? </p>