forked from github/dataease
feat(视图): 增加小数精度
This commit is contained in:
parent
2af01a0667
commit
eb085a489d
@ -997,9 +997,9 @@ public class ChartViewService {
|
||||
item[dataIndex] = null;
|
||||
} else {
|
||||
item[dataIndex] = new BigDecimal(cValue)
|
||||
.divide(new BigDecimal(lastValue), 2, RoundingMode.HALF_UP)
|
||||
.divide(new BigDecimal(lastValue), 8, RoundingMode.HALF_UP)
|
||||
.subtract(new BigDecimal(1))
|
||||
.setScale(2, RoundingMode.HALF_UP)
|
||||
.setScale(8, RoundingMode.HALF_UP)
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
@ -902,7 +902,7 @@ public class ChartDataBuild {
|
||||
if (chartViewFieldDTO.getDeType() == 0 || chartViewFieldDTO.getDeType() == 1 || chartViewFieldDTO.getDeType() == 5) {
|
||||
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? "" : ele[i]);
|
||||
} else if (chartViewFieldDTO.getDeType() == 2 || chartViewFieldDTO.getDeType() == 3) {
|
||||
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(2, RoundingMode.HALF_UP));
|
||||
d.put(fields.get(i).getDataeaseName(), StringUtils.isEmpty(ele[i]) ? null : new BigDecimal(ele[i]).setScale(8, RoundingMode.HALF_UP));
|
||||
}
|
||||
}
|
||||
tableRow.add(d);
|
||||
|
Loading…
Reference in New Issue
Block a user