int num = 199;
BigDecimal bd = new BigDecimal(num);
bd = bd.setScale(-2, BigDecimal.ROUND_DOWN);
System.out.println("向下百位取整后:" + bd.intValue());
bd = new BigDecimal(num);
bd = bd.setScale(-2, BigDecimal.ROUND_UP);
System.out.println("向上百位取整后:" + bd.intValue());
输出
向下百位取整后:100
向上百位取整后:200