|
@@ -1183,9 +1183,12 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
|
|
|
err = fmt.Errorf("日期计算配置json解析失败失败: %s, Err:%s", config, err.Error())
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- val = changePointDecimalPlaces(val, styleConf.Pn, styleConf.Nt, isPercent)
|
|
|
- cell.ShowFormatValue = val
|
|
|
+ if styleConf.Pn != 0 || styleConf.Nt != "" {
|
|
|
+ val = changePointDecimalPlaces(val, styleConf.Pn, styleConf.Nt, isPercent)
|
|
|
+ cell.ShowFormatValue = val
|
|
|
+ } else {
|
|
|
+ cell.ShowFormatValue = cell.ShowStyle
|
|
|
+ }
|
|
|
config[cellPosition.Column][cellPosition.Row] = cell
|
|
|
}
|
|
|
}
|
|
@@ -1195,9 +1198,6 @@ func handleMixCellShowStyle(showStyleList []string, calculateCellMap map[string]
|
|
|
// changePointDecimalPlaces 小数点位数加减和百分比格式
|
|
|
func changePointDecimalPlaces(str string, changeNum int, numberType string, isPercent bool) (newStr string) {
|
|
|
newStr = str
|
|
|
- if numberType == "" && changeNum == 0 {
|
|
|
- return
|
|
|
- }
|
|
|
// 把字符串转成浮点数
|
|
|
val, _ := strconv.ParseFloat(str, 64)
|
|
|
if isPercent {
|