code: public static BigDecimal cutInvalidSacle(BigDecimal val) {
  		if (val == null) return null;
  		double d = val.doubleValue();
  		int i = val.intValue();
  		if (d == i)
  			return new BigDecimal(i);
  		return new BigDecimal(Double.toString(d));
  	}
docs: Cut invalid scale.
  @param val e.g. 0.350, its scale is 3
  @return 0.35, its scale is 2.