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