Java BigDecimal,double 转int

public int setIntPoint(double contribution, BigDecimal rate) {
return BigDecimal.valueOf(contribution).multiply(rate).setScale(0, BigDecimal.ROUND_HALF_UP).intValue();
}

  

posted @ 2020-06-03 10:34  八英里  阅读(1901)  评论(0编辑  收藏  举报