workaround for BigDecimal.stripTrailingZerosBug() in Java < version 8