fix(接口测试): 修复未执行的场景通过率显示NaN的缺陷

--bug=1028834 --user=王孝刚 【接口测试】场景含脚本-导致场景未执行-通过率显示NaN
https://www.tapd.cn/55049933/s/1404654
This commit is contained in:
wxg0103 2023-08-16 16:18:38 +08:00 committed by fit2-zhao
parent eac007c3e4
commit 0d935c0bfe
1 changed files with 1 additions and 0 deletions

View File

@ -19,6 +19,7 @@ public class ResultVO {
} }
public String computerPassRate() { public String computerPassRate() {
if (this.scenarioTotal == 0) return null;
return new DecimalFormat("0%").format((float) this.scenarioSuccess / this.scenarioTotal); return new DecimalFormat("0%").format((float) this.scenarioSuccess / this.scenarioTotal);
} }
} }