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 ) ) ; }
Cut invalid scale .