double marketPrice=Double.valueOf(groupGoods.getMarketPrice());
double sellPrice=Double.valueOf(groupGoods.getSellingPrice());
if (sellPrice>marketPrice) {
throw new OpenException(ErrorCode.MARKET_HIGH_THAN_SELLING,null);
}
if ((sellPrice*100)%10>0||(sellPrice*1000)%10>0) {
throw new OpenException(ErrorCode.PRICE_LIMIT,"传入参数:SellingPrice不能超出角");
}
if ((marketPrice*100)%10>0||(marketPrice*1000)%10>0) {
throw new OpenException(ErrorCode.PRICE_LIMIT,"传入参数:marketPrice不能超出角");
}
判断价格是否是自己需要的小数位?
转载于:https://blog.51cto.com/5821034/1149918