View Single Post
Old 05-08-2024, 12:16 AM   #9
tsparr
Junior Member
tsparr began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2024
Device: Kindle Paperwhite (11th Generation)
Looks like this will handle the decimal series indexes:

Code:
python:
def evaluate(book, context):
	if book.series is None:
		author_str = ' & '.join(book.authors)
		book_str = f'{book.title} - {author_str}/{book.title} - {author_str}'
	else:
		if book.series_index.is_integer():
			book_str = f'{book.series}/{book.series} - {int(book.series_index):02} - {book.title}'
		else:
			book_str =  f'{book.series}/{book.series} - {book.series_index} - {book.title}'
	return book_str
tsparr is offline   Reply With Quote