add code to msg

This commit is contained in:
2022-01-10 11:47:03 +08:00
parent fcf1c30128
commit d0cf8768b4
2 changed files with 4 additions and 4 deletions

View File

@@ -87,7 +87,7 @@ func (f *fund) Msg() string {
if err1 == nil && err2 == nil {
rise = fmt.Sprintf("%.5f", cur-last)
}
msg := fmt.Sprintf(msgTemplate, f.FName, f.UpdateTime, f.UnitVal, f.EstimateVal, rise, f.RisePer)
msg := fmt.Sprintf(msgTemplate, f.FName, f.Code, f.UpdateTime, f.UnitVal, f.EstimateVal, rise, f.RisePer)
return msg
}
@@ -157,7 +157,7 @@ func NewFund(code string) (*fund, error) {
return ff, err
}
const msgTemplate = `%s
const msgTemplate = `%s(%s)
更新时间:%s
单位净值:%s 估算净值:%s
估算涨幅:(%s) %s%%

View File

@@ -146,7 +146,7 @@ func numFormat(num interface{}) string {
func (s *stock) Msg() string {
msg := fmt.Sprintf(msgTemplate,
s.values[0],
s.values[0], s.code,
s.values[30], s.values[31],
s.values[2], s.values[1],
s.values[3], s.rise(),
@@ -370,7 +370,7 @@ func getStockStr(codes []string) (string, error) {
return string(body), nil
}
const msgTemplate = `%s
const msgTemplate = `%s(%s)
更新时间:%s %s
昨收:%s 今开:%s
现价:%s 涨跌:%s