View Single Post
Old 02-21-2014, 09:41 AM   #319
embryo
Fanatic
embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.embryo calls his or her ebook reader Vera.
 
embryo's Avatar
 
Posts: 529
Karma: 64554
Join Date: Aug 2013
Device: Kobo Glo, GloHD
Quote:
Originally Posted by davidfor View Post
To do something like this, you need a custom column that uses a template to generate the name of the shelf. The following should work:

Code:
Lookup Name:    wordsshelfname
Column Heading: Words Shelf Name
Type:               Column built from other columns
Template: {#words:'cmp($, 100000, cmp($, 50000, cmp($, 20000, '', 'Greater than 20,000 words', 'Greater than 20,000 words'), 'Greater than 50,000 words', 'Greater than 50,000 words'), 'Greater than 100,000 Words', 'Greater than 100,000 Words')'}
Then add "#wordsshelfname" into the shelf column name field of the driver configuration.
That is a nice idea.
There is this thing though.
When I have the formating like this: {0:,} I get a "TEMPLATE ERROR invalid literal for float(): 54,916"
It works only if I change the formating to {0}, but then, the word count number is more difficult to be read.
There is this "re()" function I've read about, but since I don't know anything about programing, I don't know how to implement it. I'm experimenting, but ...
Any thoughts?
embryo is offline