Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 12-04-2018, 03:34 AM   #1231
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: 275
Karma: 426060
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook Touch HD
Quote:
Originally Posted by davidfor View Post
But, getting a non-standard formats for the locale other than a comma, seems to be hard.
I use it regularly, and it has always worked perfectly for me.
jbacelar is offline   Reply With Quote
Old 12-04-2018, 05:39 AM   #1232
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 16,083
Karma: 26100000
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by jbacelar View Post
I use it regularly, and it has always worked perfectly for me.
If you mean using "{:n}" works, then that is what I would expect. But, what I meant is that if you don't want to use the locale default, you can use a comma easily, but, getting any other character is hard. Or at least I couldn't work out how to do it without writing extra code.

But, if you have a simple way to do this, then I would be interested in seeing it.
davidfor is online now   Reply With Quote
Old 12-04-2018, 02:02 PM   #1233
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: 275
Karma: 426060
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook Touch HD
Quote:
Originally Posted by davidfor View Post
But, what I meant is that if you don't want to use the locale default, you can use a comma easily, but, getting any other character is hard.
OK, if we do not want to use 'n', it is necessary to create a custom column based on the custom column associated with the Count pages plugin (this should have the format {:,}).
In the new column the template will be:
Code:
{#pages:re(\,,.)}
In this example the new character is a dot, but we can put the character we want.
Honestly I do not see that this is hard or complicated.
jbacelar is offline   Reply With Quote
Old 12-04-2018, 07:55 PM   #1234
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 16,083
Karma: 26100000
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by jbacelar View Post
OK, if we do not want to use 'n', it is necessary to create a custom column based on the custom column associated with the Count pages plugin (this should have the format {:,}).
In the new column the template will be:
Code:
{#pages:re(\,,.)}
In this example the new character is a dot, but we can put the character we want.
Honestly I do not see that this is hard or complicated.
No, that is not hard at all. But, I said, "without writing extra code". And I had previously stated I couldn't see how to do it without an extra column. That was what I was really hoping to avoid as it feels like overkill. It also means that for every column you don't want the standard formatting, you need a second column with this template. And that's ugly and I was hoping to avoid.
davidfor is online now   Reply With Quote
Old 12-04-2018, 08:49 PM   #1235
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 12,178
Karma: 10633638
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by davidfor View Post
No, that is not hard at all. But, I said, "without writing extra code". And I had previously stated I couldn't see how to do it without an extra column. That was what I was really hoping to avoid as it feels like overkill. It also means that for every column you don't want the standard formatting, you need a second column with this template. And that's ugly and I was hoping to avoid.
Would it be possible to write a template function (see Preferences->Advanced->Template functions) that formats numbers with commas and a period in the anglo-normal way, and does the regex to change the comma's into space and the period (if any) into a comma.

Then use that template in integer and float column definitions.

BR

Last edited by BetterRed; 12-04-2018 at 09:58 PM.
BetterRed is offline   Reply With Quote
Old 12-05-2018, 12:10 AM   #1236
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 16,083
Karma: 26100000
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by BetterRed View Post
Would it be possible to write a template function (see Preferences->Advanced->Template functions) that formats numbers with commas and a period in the anglo-normal way, and does the regex to change the comma's into space and the period (if any) into a comma.

Then use that template in integer and float column definitions.
I don't know. The formatting appears to just be calling a Python format function. I don't know if that can be extended in a way that it can be used here.
davidfor is online now   Reply With Quote
Old 12-05-2018, 05:58 AM   #1237
chaley
CC Android & calibre dev
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: 8,870
Karma: 2692956
Join Date: Jan 2010
Location: UK
Device: Many android devices
Quote:
Originally Posted by BetterRed View Post
Would it be possible to write a template function (see Preferences->Advanced->Template functions) that formats numbers with commas and a period in the anglo-normal way, and does the regex to change the comma's into space and the period (if any) into a comma.

Then use that template in integer and float column definitions.

BR
Quote:
Originally Posted by davidfor View Post
I don't know. The formatting appears to just be calling a Python format function. I don't know if that can be extended in a way that it can be used here.
Davidfor is correct, the format string isn't a template. It is instead the part of a template that affects how the value is formatted.

That could be changed (process the format as a template). That would require some syntax to tell calibre that the string is a full template instead of a simple format string, perhaps something like a leading colon. It also would be a bit slower, but probably not significantly.

The real question: is the worth doing? Would more than one person use it?
chaley is offline   Reply With Quote
Old 12-05-2018, 06:48 AM   #1238
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
Quote:
Originally Posted by JimmXinu View Post
This is what I have:

Code:
{:,}
thanks
now it's much better
Sarmat is offline   Reply With Quote
Old 12-10-2018, 12:12 PM   #1239
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
is it possible to add one more function?
to calculate hours which are needed to read a book based on inserted value of average reading speed

seeing hours instead of pages is much more useful
Sarmat is offline   Reply With Quote
Old 12-10-2018, 11:13 PM   #1240
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 16,083
Karma: 26100000
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo,Aura H2O,Glo HD,Aura ONE,Clara HD,Forma;tolino epos
Quote:
Originally Posted by Sarmat View Post
is it possible to add one more function?
to calculate hours which are needed to read a book based on inserted value of average reading speed

seeing hours instead of pages is much more useful
As all you want is something like "pages / pages-per-hour", or "words / words-per-hour", you can create another column to display this. It has been discussed before with some examples of how to do it. A search through the thread should find it.
davidfor is online now   Reply With Quote
Old 12-14-2018, 05:30 AM   #1241
red_dragon
Daywalker
red_dragon is on a distinguished road
 
Posts: 29
Karma: 50
Join Date: Jul 2008
Device: Kindle Paperwhite
Sarmat,

I am using the code from Post #1110. Two posts earlier you will find a description how to add a custom column.

Different colors based on book length are also handy. You you can adjust them in Preferences -> "Look & Feel", "Column Coloring".
red_dragon is offline   Reply With Quote
Old 12-14-2018, 07:27 AM   #1242
Sarmat
Enthusiast
Sarmat began at the beginning.
 
Posts: 35
Karma: 10
Join Date: Nov 2018
Device: Kindle Paperwhite 2
red_dragon,

thank you, nice
Sarmat is offline   Reply With Quote
Old 02-08-2019, 08:05 PM   #1243
mrpops
Member
mrpops began at the beginning.
 
Posts: 14
Karma: 10
Join Date: Feb 2019
Device: Kindle
Just thought i'd post in this thread because i've spent the last hour trying to figure out why it wouldn't work, yet others had success doing the seemingly exact same thing.

If you are exporting / converting to .kfx theres a setting in the exporter that you need to change.

Click on preferences > output options > KFX output > 3rd option 'create approximate page numbers' and change the column to #pages or whatever you put.

You need to enable this column to match the #pages column like is mentioned at the start, because .kfx exports need to, for whatever reason. So simply just click that and put #pages for the column its from and everything will work like it should.

Hopefully this saves someone else an hour or so.

Thank you to everybody who has contributed, this looks so much cleaner than location.
mrpops is offline   Reply With Quote
Reply

Tags
count pages, page count

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Quality Check kiwidude Plugins 910 01-04-2019 03:01 PM
[GUI Plugin] Open With kiwidude Plugins 332 08-31-2018 09:54 AM
[GUI Plugin] Quick Preferences kiwidude Plugins 33 06-20-2018 04:00 AM
[GUI Plugin] Kindle Collections (old) meme Plugins 2070 08-11-2014 01:02 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 06:52 AM.


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