View Single Post
Old 11-22-2020, 06:21 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,453
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Three solutions. I used #series for #readorder.

1) Use GPM and the template function:
Code:
program:
	if field('#series') then
		 template('Reading List: {#series} #{#series_index:0>2s}')
	fi
2) Use a normal template, which is probably a bit faster than 1) because it avoids the nested template call
Code:
{#series:|Reading List: |}{#series_index:0>2s| #|}
3) Use GPM but avoid the call to template(). This will be the fastest if it is used as a rule or a composite column template.
Code:
program:
	f = field('#series');
	if f then
		strcat(
			'Reading List: ', f, ' #', 
			format_number(field('#series_index'), '0>2d')
		)
	fi
chaley is offline   Reply With Quote