/**
* 舍余
* @param value1 被除数
* @param value2 除数
* @param scale 精确范围
* @return 两个参数的商
* @throws IllegalAccessException
*/
public static BigDecimal div2(double value1, double value2, int scale) throws IllegalAccessException{
BigDecimal b1 = new BigDecimal(Double.valueOf(value1));
BigDecimal b2 = new BigDecimal(Double.valueOf(value2));
return b1.divide(b2, scale, RoundingMode.FLOOR);
}
}
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx