View Single Post
Old 03-20-2016, 12:00 PM   #725
JJanssen
Member
JJanssen began at the beginning.
 
Posts: 16
Karma: 24
Join Date: Jun 2009
Device: Kindle Paperwhite 1
I apologise since this is probably an FAQ, or at least previously answered, but I'm getting information overload from both this thread and the python docs.

For my Kindle plugboard I have used a line straight off the Calibre docs for years: {series}{series_index:0>3s| – | – }{title}. But since that hardcodes three digits, it fails since I occasionally use decimal series IDs. (omnibuses, short story collections, or other things that are not *actually* part of the series proper, but do have a *place* in the order). These then omit leading zeroes and sort out of sequence.

So another one mentioned in the docs is 0>5.2f -- five digits, 2 after the decimal point, if I read that correctly. That would work, but at the cost of more zeroes on my screen than I really want (since fractional indices are rare). I could do 4.1, which is better (I have never needed more than 9 sub-indices, and I could reindex the ones where I've used hundredths).

But what I *really* would want is to have 3 digits with leading zeroes normally, and *add* the decimals (ideally to the same 2 digit precision as in calibre itself) _only when needed_. So 001, 002, 003, 003.01, 003.50, 004, etc.

Is this possible or a pipedream? Looking at the python docs, I think it would almost have to involve something more than a simple format-string, which I think would make it impossible to do in calibre?

Last edited by JJanssen; 03-20-2016 at 12:00 PM. Reason: missed period.
JJanssen is offline   Reply With Quote