Quote:
Originally Posted by jbacelar
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.