test display shops

This commit is contained in:
shoopea 2020-02-14 11:16:43 +08:00
parent 5cbca6d44c
commit b1706a3d22

7
job.go
View File

@ -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)