fix: 修正金豆集市汇率计算与显示格式
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -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))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ======================
|
// ======================
|
||||||
|
|||||||
Reference in New Issue
Block a user