Code example for BigDecimal

Methods: compareTostripTrailingZeros

0
   *  
   * @param decimal  the big decimal to strip, not null 
   * @return the stripped decimal, not null 
   */ 
  public static BigDecimal stripTrailingZeros(final BigDecimal decimal) {
    if (decimal.compareTo(ZERO) == 0) {
      return ZERO;
    } else { 
      return decimal.stripTrailingZeros();
    } 
  } 
 
} 
Stop searching for code, let great code find you!  Add Codota to your java IDE