|
|
@@ -2465,6 +2465,9 @@ public class WbsTreeContractServiceImpl extends BaseServiceImpl<WbsTreeContractM
|
|
|
if (value.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
throw new ArithmeticException("不能对负数开平方");
|
|
|
}
|
|
|
+ if (value.compareTo(BigDecimal.ZERO) == 0) {
|
|
|
+ return value.setScale(precision, RoundingMode.HALF_UP);
|
|
|
+ }
|
|
|
|
|
|
// 精度设置(保留小数位 + 额外2位保证精度)
|
|
|
MathContext mc = new MathContext(precision + 2, RoundingMode.HALF_EVEN);
|