Quote:
Originally Posted by Pepin33
I'm trying to make a saving template in Calibre. I want to get an identifier from my books and format it to remove left zeros.
For example, if identifier in a book is 0000123, I want my book be saved as "123".
Identifiers are always 8 digit numbers, filled with zeros (00000001, 0000002, etc).
I'm trying to use this template: {identifiers:select(my_id):G}, but I get an error saying "my_id" is not a number, but a string.
I was looking at templates languages, but I can't find any function to convert a string to an integer. Anybody can help me?
|
I am no way a power user of the template language...But
Identifiers: usually consists of 2 parts (the colon is the separator)
1) whose: amazon:
2) the
string
Maybe you want:
identifier_in_list(val, id, found_val, not_found_val)