浏览代码

修复混合表格问题

xyxie 7 月之前
父节点
当前提交
5189d7aac4
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      services/data/excel/mixed_table.go

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

@@ -1232,7 +1232,7 @@ func changePointDecimalPlaces(str string, changeNum int, numberType string, isPe
 			} else if decimalPlaces == 1 {
 				decimalPlaces += 1
 			} else if decimalPlaces == 0 {
-				if len(str) == 1 {
+				if len(str) == 1 || len(str) > 2 {
 					decimalPlaces = 2
 				} else if len(str) == 2 {
 					if str[1] == '0' {
@@ -1246,7 +1246,7 @@ func changePointDecimalPlaces(str string, changeNum int, numberType string, isPe
 		}
 	} else {
 		if numberType == "percent" {
-			if decimalPlaces > 2 {
+			if decimalPlaces >= 2 {
 				decimalPlaces -= 2
 			} else if decimalPlaces == 1 {
 				decimalPlaces = 0