问题 遇到2个数相除,需要保留2位小数的结果。 解决 BigDecimal sum = ...; BigDecimal yearValue = ...;MathContext mathContext = new MathContext(2, RoundingMode.DOWN); yearValue.divide(sum, mathContext);