Here you can find the source of stripTrailingZeros(BigDecimal value)
Workaround for <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6480539">bug #6480539</a>: BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0").
public static BigDecimal stripTrailingZeros(BigDecimal value)
//package com.java2s; import java.math.BigDecimal; public class Main { /**/*from w w w . j a va 2 s. c o m*/ * Workaround for <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6480539">bug #6480539</a>: * BigDecimal.stripTrailingZeros() has no effect on zero itself ("0.0"). */ public static BigDecimal stripTrailingZeros(BigDecimal value) { return (value.compareTo(BigDecimal.ZERO) == 0 ? BigDecimal.ZERO : value.stripTrailingZeros()); } }