小数位为零直接输出整数

master
e 2019-01-05 22:04:22 +08:00
parent 77c79f0fe2
commit 0db51621b6
2 changed files with 13 additions and 1 deletions

View File

@ -285,6 +285,7 @@ public class WmOmNoticeHController extends BaseController {
}catch ( Exception e){
}
tom.setBaseGoodscount(StringUtil.getdouble(tom.getBaseGoodscount()));
wmOmQmIEntityListnew.add(tom);
}
}catch ( Exception e){

View File

@ -478,6 +478,17 @@ public class StringUtil {
return sb.append(str).toString();
}
public static String getdouble(String inDouble)
{
Double mainWastage = Double.parseDouble(inDouble);
//主材损耗费取整
if(mainWastage.intValue()-mainWastage==0){//判断是否符合取整条件
return String.valueOf(mainWastage.intValue());
}else{
return String.valueOf(mainWastage);
}
}
/**
*