Quote:
Originally Posted by kiwidude
I have been forever using this plugboard for my Kindle from the first post:
{series:|| }{series_index:0>2s|[|] - }{title}
However one thing that it doesnt get right is when the series index is not a round number - e.g. 1.5, 3.1 etc. In those circumstances it does not put the leading 0, which means the ordering is all wrong.
So you end up with:
My Series [01] - Title 1
My Series [02] - Title 2
My Series [1.5] - Title 1.5
Is there a way of fixing this?
|
The 's' means treat the series as a string. The '2' in front means that it must be at least two letters long. The zero in front of the '>' means fill will the character '0' to meet the minimum length.
Your problem is that you want to treat the series as a floating point number with minimum sizes to the left and right of the decimal. This requires you to use a different type in the template. For example
Code:
{series:|| }{series_index:0>5.1f|[|] - }{title}
will give you minimum 3 digits to the left of the point, the point itself, and 1 digit to the right of the point. If all of your series indices are less than 1000 and have at most 1 digit to the right of the point then the template will work for you. Of course you can adjust the '5' and the '1' to meet your needs.