保留两位小数

This commit is contained in:
chenjianxing 2020-05-21 09:35:40 +08:00
parent a64c63cc7d
commit 8853b39dd7
1 changed files with 3 additions and 3 deletions

View File

@ -205,9 +205,9 @@ public class TestPlanService {
}
private double getPercentWithTwoDecimals(double value) {
return new BigDecimal(value)
.setScale(4, BigDecimal.ROUND_HALF_UP)
.doubleValue() * 100;
return new BigDecimal(value * 100)
.setScale(2, BigDecimal.ROUND_HALF_UP)
.doubleValue();
}
public List<TestPlanCaseDTO> listTestCaseByPlanId(String planId) {