fix: 修正金豆集市汇率计算与显示格式
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-23 06:41:34 +08:00
committed by cnb
parent 5773b8d182
commit ce3f1fc02e

View File

@@ -16,8 +16,8 @@ func startrobot() {
Handle(func(ctx *zero.Ctx) { Handle(func(ctx *zero.Ctx) {
var msgs []string var msgs []string
for _, v := range service.NewGoldListService(0).Get() { for _, v := range service.NewGoldListService(0).Get() {
v.Rate = 1 / v.Rate
msgs = append(msgs, fmt.Sprintf("数量:%d 单价:%.2f 总价:%.2f", v.ExchangeNum, v.Rate, float64(v.ExchangeNum)*v.Rate)) msgs = append(msgs, fmt.Sprintf("数量:%d 汇率:%.2f 所需金币:%.2f", v.ExchangeNum, 1/v.Rate, float64(v.ExchangeNum)*v.Rate))
} }
// ====================== // ======================