View Single Post
Old 04-16-2021, 04:09 AM   #7
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,463
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by MarjaE View Post
Hi, I have a #ratio column:

program: format_number(divide(booksize(),add(raw_field("#pa ges"),1)),"{0:,.0f}")

How could I amend that to avoid showing values of 0 or none?
I don't know what version of calibre you are running so I am using the older syntax.
Code:
program: 
	s = divide(booksize(),add(raw_field("#pages"),1));
	cmp(s, 0, '', '', format_number(s,"{0:,.0f}"))
chaley is offline   Reply With Quote