Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 06-05-2026, 02:50 AM   #16
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 75,705
Karma: 320245586
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Quote:
Originally Posted by whiteowl View Post
I do not want it to sort numerically. I want to see the same percentage as it is shown in bottom-right corner of the Viewer, and I want that column to be sortable as any normal human does sort percentage values. That is all I want.
Define the column to be floating point. Once you've done that and it's displaying pure numbers, right-click on the column heading in the main calibre window and choose "Edit column definition for <column name>".

In the dialog that appears, there's a field "Format for numbers"

If your numbers are between 0 and 1 in progress, enter {:.0%}
If your numbers are between 0 and 100, enter {:.0f}%

And then when sorting the column it will sort correctly using the underlying number, but display as a nicely formatted percentage.
pdurrant is offline   Reply With Quote
Old 06-05-2026, 08:52 AM   #17
whiteowl
Enthusiast
whiteowl began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jan 2020
Device: none
Quote:
Originally Posted by pdurrant View Post
Define the column to be floating point. Once you've done that and it's displaying pure numbers, right-click on the column heading in the main calibre window and choose "Edit column definition for <column name>".
Ok. But after I done that - I have a column where I need to manually enter the values. This dialog does not have a field for entering expression which will produce the value automatically.
whiteowl is offline   Reply With Quote
Advert
Old 06-05-2026, 11:03 AM   #18
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 75,705
Karma: 320245586
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Ah - I had no idea that calibre had such a thing. I don't really use the bult-in viewer.

OK, change your column definition to have

Code:
{id:reading_progress(, 'number')}
instead of the percent thing, and then use the column formatting as I described earlier.
pdurrant is offline   Reply With Quote
Old 06-05-2026, 11:18 AM   #19
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,350
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by whiteowl View Post
Sorry, I do not understand how you did it.

When I click on "Read Progress" template - it creates a "Column type: Column built from other columns". There is no field for formatting.
Attempt to change that column type to Float, adds a field "Format for numbers", but removes the "Template" field with the function.

So: how do you format the "Column built from other columns"?


Again: How? What should I click in the UI to get to the field where I would be able to type that expression?
Quote:
Originally Posted by whiteowl View Post
Ok. But after I done that - I have a column where I need to manually enter the values. This dialog does not have a field for entering expression which will produce the value automatically.
The floating point column must be filled manually or synced with another source (like Goodreads or a Kobo). It does not work with the viewer. I was just expliciting the difference in sorting.

To create such a column, you do like explained by @pdurrant.

As for the template I suggested. Proceed like this:
1) Open the 'Add your own columns' window
2) Select your 'Reading progress' column (the one that syncs with the Viewer)
3) Click the 'Edit' button on the right
4) In the 'Template' field, remove the standard template e copy/paste this:
Code:
program:
	format_number(reading_progress($id, '', 'pos_frac')*100, '{:.0f}')
5) Make sure it is set to sort by 'Number'
6) Apply and restart
thiago.eec is offline   Reply With Quote
Old 06-05-2026, 11:20 AM   #20
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 83,729
Karma: 153649587
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
This is how I have my percent column defined. It's integer but shows %.

01%
10%
100%

Click image for larger version

Name:	percent.jpg
Views:	23
Size:	73.1 KB
ID:	223732
JSWolf is offline   Reply With Quote
Advert
Old 06-06-2026, 09:19 PM   #21
whiteowl
Enthusiast
whiteowl began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jan 2020
Device: none
Quote:
Originally Posted by thiago.eec View Post
As for the template I suggested. Proceed like this:
1) Open the 'Add your own columns' window
2) Select your 'Reading progress' column (the one that syncs with the Viewer)
3) Click the 'Edit' button on the right
4) In the 'Template' field, remove the standard template e copy/paste this:
Code:
program:
	format_number(reading_progress($id, '', 'pos_frac')*100, '{:.0f}')
5) Make sure it is set to sort by 'Number'
6) Apply and restart
Ok. Looks easy enough. But the `Template` field is just a one-liner. You are suggesting to type two lines....
....
Ok, I see my mistake now. It should be really a one liner and word `program:` is essential.
Code:
program: format_number(reading_progress($id, '', 'pos_frac')*100, '{:.0f}')
Now we have a number 0-100 in the column.

That expression should be mentioned in documentation, I think.
whiteowl is offline   Reply With Quote
Old 06-07-2026, 12:47 PM   #22
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,350
Karma: 1436993
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by whiteowl View Post
Ok. Looks easy enough. But the `Template` field is just a one-liner. You are suggesting to type two lines....
....
Ok, I see my mistake now. It should be really a one liner and word `program:` is essential.
You could just copy and paste like I said. But you can also right click the template field and open the Template Editor, in case you need to create more complex templates. I always use the editor, so that's why the code I send had two lines. Also, you will be able to see all the functions available (plus documentation) and test your template as you type.
thiago.eec is offline   Reply With Quote
Old 06-10-2026, 10:39 AM   #23
whiteowl
Enthusiast
whiteowl began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jan 2020
Device: none
Quote:
Originally Posted by thiago.eec View Post
But you can also right click the template field and open the Template Editor,
Ahm... It is helpful to know about such functionality. But who can guess it???
whiteowl is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sort by author and then publish date (multi-column sort)? badbob001 Library Management 7 07-22-2020 06:45 PM
Trying to make a percentage progress composit column. Kythe42 Library Management 13 12-26-2019 05:14 PM
Column built from other column : Mark read if evaluated Cmely Library Management 1 02-26-2017 09:07 AM
Manual Sort or Sort by custom column Dethmaul Marvin 2 04-28-2014 11:54 AM
Multi column sort? nexus100 Calibre 1 07-11-2010 11:19 PM


All times are GMT -4. The time now is 05:08 PM.


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