Explorar el Código

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

zqbao hace 5 meses
padre
commit
ad27503428
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  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 {