Explorar el Código

fix:同花顺指标 因为table里面的value有的时候返回的是string,有的是float64,所以需要用interface来反射取值

Roc hace 2 años
padre
commit
d4f41a7cb0
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      services/base_from_ths.go

+ 1 - 1
services/base_from_ths.go

@@ -97,7 +97,7 @@ func getEdbDataFromThs(edbCode, startDate, endDate string, num int) (item *EdbDa
 					err = tmpErr
 					return
 				}
-				tableValue, _ = tmpTableValue.Float64()
+				tableValue, _ = tmpTableValue.Truncate(4).Float64()
 			} else {
 				err = errors.New("错误的数据类型" + reflect.TypeOf(tmpValue).String())
 				return