xyxie 1 ano atrás
pai
commit
9cb4d4b41a
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      services/data/table/mixed_table.go

+ 3 - 0
services/data/table/mixed_table.go

@@ -1229,6 +1229,9 @@ func changePointDecimalPlaces(str string, changeNum int) (newStr string) {
 	}
 	dotIndex := strings.Index(str, ".") // 查找小数点的位置
 	if dotIndex == -1 {
+		if changeNum > 0 { // 增加小数位数
+			newStr += "." + strings.Repeat("0", changeNum)
+		}
 		return // 没有小数点,返回0
 	}
 	decimalPlaces := len(str) - dotIndex - 1 // 计算小数位数