浏览代码

fix:混合表格小数位数历史数据

zqbao 5 月之前
父节点
当前提交
ad27503428
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      services/excel/lucky_sheet.go

+ 11 - 0
services/excel/lucky_sheet.go

@@ -1230,6 +1230,17 @@ func GetTableDataByMixedTableData(config [][]request.MixedTableCellDataReq, hide
 						if styleConfig.Nt == "percent" {
 							hasPercent = true
 						}
+						// 修复历史数据
+						if styleConfig.Pn != 0 {
+							if styleConfig.Decimal == nil {
+								styleConfig.Decimal = new(int)
+							}
+							*styleConfig.Decimal += styleConfig.Pn
+							if *styleConfig.Decimal < 0 {
+								*styleConfig.Decimal = 0
+							}
+						}
+
 						if styleConfig.Decimal != nil {
 							tmp.Monitor = roundNumber(cell.ShowValue, *styleConfig.Decimal, hasPercent)
 						} else {