Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-09-2021, 12:35 AM   #1
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 1,178
Karma: 1900479
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
size in kb column

how do I make a size column that shows the kb? - I have multiple copies of the same book that is only differentiated by the size and I want to know in kb instead of mb because the files on my computer need to match the files in Calibre so I know which to keep and which to chuck.

Thanks!
Rellwood is offline   Reply With Quote
Old 03-09-2021, 03:02 AM   #2
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
This is the template I use in the custom column for Kbytes:

program:
a=divide(booksize(), 1024);
a=re(a,'(\d+)\.\d+','\1');
a=add(a,1);
format_number(a,'n');


And so I have exactly the same value that the file shows in Windows.
jbacelar is offline   Reply With Quote
Advert
Old 03-09-2021, 05: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: 11,866
Karma: 7036359
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by jbacelar View Post
This is the template I use in the custom column for Kbytes:

program:
a=divide(booksize(), 1024);
a=re(a,'(\d+)\.\d+','\1');
a=add(a,1);
format_number(a,'n');


And so I have exactly the same value that the file shows in Windows.
Just FYI:

Starting in calibre 4.23 you can write:
Code:
program:
	format_number(add(floor(divide(booksize(), 1024)), 1), 'n')
The 'floor()' function was added in that release.

Starting in the next calibre release (5.13) you can write:
Code:
program:
	format_number(floor(booksize()/1024)+1,'n')
The arithmetic operators will be added in that release.
chaley is offline   Reply With Quote
Old 03-09-2021, 10:43 AM   #4
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Quote:
Originally Posted by chaley View Post
The 'floor()' function was added in that release

Thank you very much, I was not aware of the existence of "floor()".
jbacelar is offline   Reply With Quote
Old 03-09-2021, 04:00 PM   #5
Rellwood
Library Breeder (She/Her)
Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.Rellwood ought to be getting tired of karma fortunes by now.
 
Rellwood's Avatar
 
Posts: 1,178
Karma: 1900479
Join Date: Apr 2015
Location: Fullerton, California
Device: Kobo Aura HD (1) PW3 (4) PW3 2019 new edition (1)
Quote:
Originally Posted by chaley View Post
Just FYI:

Starting in calibre 4.23 you can write:
Code:
program:
	format_number(add(floor(divide(booksize(), 1024)), 1), 'n')
The 'floor()' function was added in that release.

Starting in the next calibre release (5.13) you can write:
Code:
program:
	format_number(floor(booksize()/1024)+1,'n')
The arithmetic operators will be added in that release.
I hate to ask, but how do I turn this into a column? I never understood programing in Calibre. I was never able to use the program/coding function.
Rellwood is offline   Reply With Quote
Advert
Old 03-09-2021, 05:55 PM   #6
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: 9,087
Karma: 62580135
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by Rellwood View Post
I hate to ask, but how do I turn this into a column? I never understood programing in Calibre. I was never able to use the program/coding function.
Click image for larger version

Name:	2021-03-09 18_54_34-calibre — __ My Books.png
Views:	98
Size:	74.2 KB
ID:	185842
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Column for size pictures Polleke1945 Library Management 2 11-15-2017 05:41 AM
Size column shows exactly what? unboggling Library Management 4 11-21-2013 02:44 PM
Column for cover size? Black Scholes Library Management 2 11-08-2013 03:07 AM
size column iomari Calibre 6 09-30-2011 07:00 AM
Refresh size column Perkin Calibre 5 09-10-2010 11:31 AM


All times are GMT -4. The time now is 09:50 AM.


MobileRead.com is a privately owned, operated and funded community.