View Single Post
Old 02-07-2023, 01:42 AM   #8013
culytera
Zealot
culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.culytera ought to be getting tired of karma fortunes by now.
 
Posts: 130
Karma: 295674
Join Date: Jul 2021
Device: iPhone
Quote:
Originally Posted by ownedbycats View Post
I use this for displaying floating-point purchase cost in the tag browser. It can be easily changed to use integer wordcount.

EDIT: Note switch_if is a relatively new function, two or three versions ago. If you're using an older version may not be present.

Code:
...
I tried to make a template for grouping word count on Calibre based on this, but it wasn't working properly for me despite having Calibre updated. I saw a different one which worked.
Code:
program:
	getWordCount = field('#ao3_words');
	wordCount = re(getWordCount, '[,]', '');
	first_non_empty(
		cmp(wordCount, 5001, '0 - 5000', '', ''),
		cmp(wordCount, 10001, '5001 - 10000', '', ''),
		cmp(wordCount, 20001, '10001 - 20000', '', ''),
		cmp(wordCount, 40001, '20001 - 40000', '', ''),
		cmp(wordCount, 80001, '40001 - 80000', '', ''),
		'80000+'
);
It looks like this for me. I wish MapleRead could sort by groups, but it's limited so I'm making do with tag grouping.
Attached Thumbnails
Click image for larger version

Name:	[calibre] 2023-02-07 14-20-03.jpg
Views:	194
Size:	84.5 KB
ID:	199548  
culytera is offline   Reply With Quote