java中对doubl整数去除整数后的 .0 解决方法
今天在limit后使用double一直报错是因为 double整数后有个.0
网上找了一些方法 例如math.floor、Math.rint等 如果赋值给double 还是会带.0,最后想到另一种方法
DecimalFormat format = new DecimalFormat("#");
int strNum = Integer.parseInt(format.format(pageNum));
int strSize = Integer.parseInt(format.format(pageSize));
先用DecimalFormat 转换一个格式,在转换回来就ok啦,遇到一个小问题。记录一哈。