|
|
#376 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,374
Karma: 79699999
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
What would be the best way to turn this into templates for the KoboTouch read estimates?
Code:
HoursMax = round(WordCount / 200 / 60)
HoursMin = HoursMax - 1
if (HoursMax >= 10) {
HoursMax += round((HoursMax + .5) / 10) - 1)
}
![]() Code:
program: round(divide(divide($#wordcount, 200), 60)) |
|
|
|
|
|
#377 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: HoursMax = round($$#wordcount / 200 / 60); HoursMin = HoursMax - 1; if (HoursMax >= 10) then HoursMax = HoursMax + round((HoursMax + .5) / 10) - 1 fi Code:
HoursMax = round($$#wordcount / 12000); |
|
|
|
|
|
|
#378 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,374
Karma: 79699999
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Thanks
|
|
|
|
|
|
#379 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,374
Karma: 79699999
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I have a template to update $#kobostatus (enumerated column):
Code:
program: category = first_non_empty( if $#fanficcat then '[Fanfiction]' elif 'Loans' inlist $#vls then '[Loans]' elif '\[Kobo Store\]' in $#kobostatus then '[Kobo Store]' else '[Sideloaded]' fi ); Last edited by ownedbycats; 04-26-2022 at 06:04 PM. |
|
|
|
|
|
#380 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
|
|
|
|
|
#381 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,374
Karma: 79699999
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
$#kobostatus is enumerated. I use the template to semi-automatically generate/update it during certain action chains.
"Better" I'm not sure of -- I'm not sure if referencing the column that you're updating is best practice. |
|
|
|
|
|
#382 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
elif '[Kobo Store]' == $#kobostatus then '[Kobo Store]' I suggest you go with the code you understand. |
|
|
|
|
|
|
#383 |
|
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,374
Karma: 79699999
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Thanks
|
|
|
|
|
|
#384 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 924
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Hello people, help me with a regular expression that counts the letters of a title
|
|
|
|
|
|
#385 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
|
|
|
|
|
#386 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 924
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
|
|
|
|
|
|
#387 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
In what context? Searching? A custom column? A plugin? Something else?
EDIT: For example, if you are talking about a template then something like this should work. Code:
program: strlen($title) Last edited by chaley; 05-03-2022 at 06:08 PM. |
|
|
|
|
|
#388 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 924
Karma: 810834
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
|
|
|
|
|
|
#389 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,166
Karma: 92500001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
Probably being overly pedantic here, but that gives the number of characters, not the number of letters. Of course that may be what was actually desired.
|
|
|
|
|
|
#390 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,526
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
I thought of that but the solution using the template language is nontrivial and perhaps not possible. It can be done in a custom python template function but that is more than I care to do.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Library Management: various questions not worth their own thread | ownedbycats | Library Management | 253 | 10-21-2025 09:15 AM |
| [Metadata Source Plugin] Questions regarding parse select, docs and ref templates | Boilerplate4U | Development | 13 | 07-07-2020 03:35 AM |
| Questions on Kobo [Interfered with another thread topic] | spdavies | Kobo Reader | 8 | 10-12-2014 12:37 PM |
| [OLD Thread] Some questions before buying the fire. | darthreader13 | Amazon Fire | 7 | 05-10-2013 10:19 PM |
| Thread management questions | meme | Feedback | 6 | 01-31-2011 06:07 PM |