This commit is contained in:
邹宗楠
2024-12-18 17:12:10 +08:00
parent d5e46f7fd2
commit 0ad94d882a
3 changed files with 7 additions and 3 deletions

View File

@@ -179,8 +179,12 @@ func FormatPrintOrderItemV2(foodName string, quantity, cnt int) string {
} else {
restLen = foodNameLen - LineLength
}
repeatTimes := MaxLineLength - restLen
if repeatTimes < 0 {
repeatTimes = MaxLineLength
}
result += `<font# bolder=0 height=2 width=1>` + utils.Int2Str(cnt) + `.` + foodName
result += StrRepeat(" ", MaxLineLength-restLen) + `x` + quantityStr + `</font#>`
result += StrRepeat(" ", repeatTimes) + `x` + quantityStr + `</font#>`
} else {
result += `<font# bolder=0 height=2 width=1>` + utils.Int2Str(cnt) + `.` + foodName + StrRepeat(" ", MaxLineLength-foodNameLen) + `x` + quantityStr + `</font#>`
}