hsun 8 сар өмнө
parent
commit
ed562d48da

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

@@ -1258,7 +1258,8 @@ func changePointDecimalPlaces(str string, changeNum int, numberType string, isPe
 		val, _ = decimal.NewFromFloat(val).Round(int32(decimalPlaces)).Float64()
 		newStr = strconv.FormatFloat(val, 'f', decimalPlaces, 64)
 	} else {
-		newStr = fmt.Sprintf("%v", val)
+		// 此处用%.f避免科学计数法, 从而导致后面出现很多位0
+		newStr = fmt.Sprintf("%.f", val)
 	}
 	// 计算小数位数
 	decimalPlaces = 0