View Single Post
Old 04-14-2011, 07:06 AM   #219
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Dopedangel View Post
I was wondering if this was possible I am using this for series
{series_index:0>2s} {title}
and normally it works great but their are some series with short stories that are numbered 1.2 etc and they don't sort properly in my reader as they show up as

01
02
03
04
1.2

where I would prefer

01
01.2
02
03
See the template language manual http://calibre-ebook.com/user_manual/template_lang.html. In there you will find several examples of formatting numbers. Quoting that document:
If you use series indices with sub values (e.g., 1.1), you might want to ensure that the decimal points line up. For example, you might want the indices 1 and 2.5 to appear as 01.00 and 02.50 so that they will sort correctly. To do this, use:

Code:
{series_index:0>5.2f} - Five characters, consisting of two digits with leading zeros, a decimal point, then 2 digits after the decimal point
Quote:
Another problem is I am using

Ebooks/{tags}/{authors[0]}/{authors}/{series}/{series_index:0>2s|.| }{title}

but that sorts as

A
B
C
Crime
D

How would I go about putting brackets on the tag field so I can sort properly
That list is correctly sorted. What is it that you want to be different?

In any event, you can add brackets around tags with
Code:
Ebooks/{tags:|[|]/}{authors[0]}/{authors}/{series}/{series_index:0>2s|.| }{title}
chaley is offline   Reply With Quote