Merge pull request #9577 from dataease/pr@dev@fix_calc

fix(视图): 修复同环比差值百分比分母没取绝对值的问题
This commit is contained in:
Junjun 2024-05-10 10:30:28 +08:00 committed by GitHub
commit 3956c325e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -1430,7 +1430,7 @@ public class ChartViewService {
item[dataIndex] = null;
} else {
item[dataIndex] = new BigDecimal(cValue)
.divide(new BigDecimal(lastValue), 8, RoundingMode.HALF_UP)
.divide(new BigDecimal(lastValue).abs(), 8, RoundingMode.HALF_UP)
.subtract(new BigDecimal(1))
.setScale(8, RoundingMode.HALF_UP)
.toString();

View File

@ -48,7 +48,7 @@
<span
v-else-if="compareItem.compareCalc.resultData === 'percent'"
class="exp-style"
>(本期数据 / 上期数据 - 1) * 100%</span>
>(本期数据 / |上期数据| - 1) * 100%</span>
</el-form-item>
</el-form>
</div>