From b1706a3d224ffd78367ff7eb9e0c3d9710e31871 Mon Sep 17 00:00:00 2001 From: shoopea Date: Fri, 14 Feb 2020 11:16:43 +0800 Subject: [PATCH] test display shops --- job.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/job.go b/job.go index 5dd438b..7d44353 100644 --- a/job.go +++ b/job.go @@ -2274,11 +2274,12 @@ func jobShops(j Job) { if cwm.Mana < cwm.ManaTotal { t := (cwm.ManaTotal - cwm.Mana) / ((cwm.ManaTotal / 250) + 1) d := time.Duration(t) * time.Minute - if d.Hours() > 0 { - out = fmt.Sprintf("%s%dh\n", out, d.Hours) + if d.Hours() > 1 { + out = fmt.Sprintf("%s%.0fh\n", out, d.Hours) } + d = d - d.Truncate(1*time.Hour) if d.Minutes() > 0 { - out = fmt.Sprintf("%s%dm\n", out, d.Minutes) + out = fmt.Sprintf("%s%.0fm\n", out, d.Minutes()) } } else { out = fmt.Sprintf("%s\n", out)