xyxie 1 年之前
父节点
当前提交
9cb4d4b41a
共有 1 个文件被更改,包括 3 次插入0 次删除
  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 // 计算小数位数