Browse Source

Merge branch 'hotfix/mix_table_percent' into debug

xyxie 7 months ago
parent
commit
95703ebf1b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      services/data/excel/mixed_table.go

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

@@ -1255,7 +1255,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' {
@@ -1269,7 +1269,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