xyxie преди 1 година
родител
ревизия
cd6d07906d
променени са 1 файла, в които са добавени 7 реда и са изтрити 2 реда
  1. 7 2
      services/data/excel/mixed_table.go

+ 7 - 2
services/data/excel/mixed_table.go

@@ -1207,14 +1207,19 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
 				return
 			}
 			// todo 处理百分号,和小数点位数增加或者减少
+			if styleConf.NumberStyle.AddPointNum != 0 {
+				//val = CountDecimalPlaces(val)
+			}
+			if styleConf.NumberStyle.IsPercent == 1 {
+
+			}
 			cell.ShowValue = val
 			config[cellPosition.Column][cellPosition.Row] = cell
 		}
 	}
 	return
 }
-func CountDecimalPlaces(num float64) int {
-	str := fmt.Sprintf("%f", num)       // 将浮点数转换为字符串
+func CountDecimalPlaces(str string) int {
 	dotIndex := strings.Index(str, ".") // 查找小数点的位置
 	if dotIndex == -1 {
 		return 0 // 没有小数点,返回0