/**
* @Title: 处理金额
* @Description:
*/
public static String dealLimitAmount(BigDecimal inNum){
String ret = "";
if(inNum.compareTo(new BigDecimal("10000")) < 0){
ret = inNum + "";
}else if(inNum.compareTo(new BigDecimal("1000000")) < 0){
ret = inNum.divide(new BigDecimal("10000")) + "万";
}else if(inNum.compareTo(new BigDecimal("10000000")) < 0){
ret = inNum.divide(new BigDecimal("1000000")) + "百万";
}else if(inNum.compareTo(new BigDecimal("100000000")) < 0){
ret = inNum.divide(new BigDecimal("10000000")) + "千万";
}else if(inNum.compareTo(new BigDecimal("100000000")) >= 0){
ret = inNum.divide(new BigDecimal("100000000")) + "亿";
}
return ret;
}
校验金额:
if(!F.validate.isZInt(vo.getExp_amount())) {
throw new MsgBusinessException("填写金额错误");
}
if(Integer.parseInt(vo.getExp_amount()) == 0) {
throw new MsgBusinessException("输入金额应该大于0");
}