View Single Post
Old 08-23-2021, 04:45 AM   #144
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 11,099
Karma: 76037135
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Question: for my composite chapter count column:

Click image for larger version

Name:	2021-08-23 05_41_51-calibre — __ My Books __ Fanfiction __.png
Views:	2551
Size:	1.5 KB
ID:	188857

Is it possible, with a template, to display icon only if the first number is one less than the second?

1/2 - icon.png
2/2 - no icon
99/100 - icon.png
50/100 - no icon
50 - no icon

If it helps, here's the composite. It pulls the numbers from #chaptercount and #kobobookmark:

Code:
program:

input = $#kobobookmark;
status = $#fanficstatus;
ccount = $$#chaptercount;

	if 
		$#fanficcat
	then
		if		
				substr(input, 0, 10) == 'OEBPS/file'
			&& 	
				!status inlist 'Anthology,Oneshot'

		then		
			strcat(format_number(re(input, '.*\/file(\d+).*', '\1') - 1, '{0:,d}'), '/',ccount)
		else
			ccount
		fi

	elif
		ccount == 'None'
	then
		'Not Set'

	elif
		ccount >#1
	then
		ccount

	fi
Thank you.

Last edited by ownedbycats; 08-23-2021 at 04:49 AM.
ownedbycats is online now   Reply With Quote