String cellValue = "";
double numericCellValue = cell.getNumericCellValue();
BigDecimal bd2 = new BigDecimal(String.valueOf(numericCellValue)).setScale(6, BigDecimal.ROUND_HALF_UP);
cellValue = bd2.stripTrailingZeros().toPlainString();
return cellValue;
stripTrailingZeros是小数点后最后的0全部去除
最后
以上就是无心手链最近收集整理的关于BigDecimal去除小数位的全部内容,更多相关BigDecimal去除小数位内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复