public static void main(String[] args) {
int i = new BigDecimal(100).multiply(new BigDecimal(0.01)).multiply(new BigDecimal(2)).setScale(0, BigDecimal.ROUND_UP).intValue();
System.out.println(i);
}
运行结果:3
double v = 100 * 0.01 * 2;
int ceil = (int) Math.ceil(v);
System.out.println(ceil);
运行结果:2