java 百分比四舍五入

 BigDecimal fz = new BigDecimal(mCZ.get("ybj").toString());
 BigDecimal fm = new BigDecimal(mCZ.get("zs").toString());
 BigDecimal bfs = new BigDecimal(100);
  BigDecimal bResult = fz.divide(fm,4, BigDecimal.ROUND_HALF_UP);
  mCZ.put("bjl",String.valueOf(bResult.multiply(bfs).setScale(2,RoundingMode.HALF_UP)));
			
posted @ 2024-11-26 16:46  寒冷的雨呢  阅读(5)  评论(0编辑  收藏  举报