mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-25 00:02:37 +02:00
improve fmt part, using consistant size
This commit is contained in:
parent
afc3355e0d
commit
5276f2ba6f
@ -247,7 +247,9 @@ func (e *ePub) Write() error {
|
||||
ext := filepath.Ext(e.Output)
|
||||
suffix := ""
|
||||
if totalParts > 1 {
|
||||
suffix = fmt.Sprintf(" Part %02d of %02d", i+1, totalParts)
|
||||
fmtLen := len(fmt.Sprint(totalParts))
|
||||
fmtPart := fmt.Sprintf(" Part %%0%dd of %%0%dd", fmtLen, fmtLen)
|
||||
suffix = fmt.Sprintf(fmtPart, i+1, totalParts)
|
||||
}
|
||||
|
||||
path := fmt.Sprintf("%s%s%s", e.Output[0:len(e.Output)-len(ext)], suffix, ext)
|
||||
|
Loading…
x
Reference in New Issue
Block a user