View Single Post
Old 02-07-2021, 09:47 AM   #11
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,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by dunhill View Post
The formats_sizes function converts from mb to kb?
Or how would the syntax be for a custom column.
The formats_sizes function returns a list of all the formats with the size in bytes. If you want the size in some other scale then you must compute it yourself.

For example, this template returns the size of the EPUB format in KB, or the empty string if there isn't an EPUB format.
Code:
program:
	if epub_size = select(formats_sizes(), 'EPUB') then 
		format_number(floor(divide(epub_size, 1024)), '{:,d} KB')
	fi
You can also use the human_readable() function that chooses a reasonable scale factor.
Code:
program:
	human_readable(select(formats_sizes(), 'EPUB'))

Last edited by chaley; 02-07-2021 at 09:51 AM.
chaley is offline   Reply With Quote