ソースを参照

Merge branch 'chart/13.7'

# Conflicts:
#	models/base_from_manual.go
Roc 1 年間 前
コミット
06fb7c30ae
1 ファイル変更13 行追加0 行削除
  1. 13 0
      models/base_from_manual.go

+ 13 - 0
models/base_from_manual.go

@@ -3,6 +3,7 @@ package models
 import (
 	"fmt"
 	"github.com/beego/beego/v2/client/orm"
+	"github.com/shopspring/decimal"
 	"hongze/hongze_edb_lib/utils"
 	"strconv"
 	"strings"
@@ -54,6 +55,13 @@ func AddEdbDataFromManual(edbCode string) (err error) {
 			item := manualDataList[i]
 			eDate := item.Dt
 			sValue := item.Close
+			tmpDecimal, err := decimal.NewFromString(sValue)
+			if err != nil {
+				return err
+			}
+			sValue = tmpDecimal.Round(4).String()
+
+
 			dataTime, err := time.ParseInLocation(utils.FormatDate, eDate, time.Local)
 			if err != nil {
 				return err
@@ -147,6 +155,11 @@ func RefreshEdbDataFromManual(edbInfoId int, edbCode, startDate string) (err err
 		item := v
 		eDate := item.Dt
 		sValue := item.Close
+		tmpDecimal, err := decimal.NewFromString(sValue)
+		if err != nil {
+			return err
+		}
+		sValue = tmpDecimal.Round(4).String()
 
 		dataTime, err := time.ParseInLocation(utils.FormatDate, eDate, time.Local)
 		if err != nil {