![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jul 2021
Device: Kindle paperwhite
|
Format words count 1500 as 1.5k
Hello,
I created a custom column "Words" that I fill with the FanFicFare plugin (collecting the number of words from the fanfiction website). Is there a method to format the numbers in kilo? For example, 1500 as 1.5k or 34267 as 34.3k. I noticed that python format can be used to format custom column but it does not allow python function which would be needed for what I want (see the page https://www.geeksforgeeks.org/python-numerize-library/). Thank you! |
![]() |
![]() |
![]() |
#2 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
As for formatting the result in the composite, you have the option of using the human_readable() function or doing the arithmetic yourself. |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jul 2021
Device: Kindle paperwhite
|
Quote:
Code:
human_readable(words) Thank you! Last edited by Courge; 07-01-2021 at 06:45 PM. |
|
![]() |
![]() |
![]() |
#4 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Courge - When referring to custom columns in a template etc you need to prefix the lookup_name with a hash - eg. #words
BR |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
My guess is that you want something like this Single Function Mode template Code:
{#words:human_readable()} |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jul 2021
Device: Kindle paperwhite
|
Thanks to both of you for your answers. I got what I want writing the following template:
Code:
program: before = round($$#words/1000); after = round(($$#words-(before*1000))/100)*0.1; complete=before+after |
![]() |
![]() |
![]() |
#7 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
I initially interpreted your request as wanting 1024 words to be 1K words. I decided against asking why you'd wanna do that.
![]() BR |
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
I'm generally against capital punishment, but for the person who thought, "Kilo=1000, 1024 is close enough", I'm willing to make an exception.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Count words in whole book | franc | Reading and Management | 16 | 03-31-2021 05:35 PM |
Page Count not appearing in ipad kindle - mobi format | eloigorri | Devices | 9 | 06-17-2020 04:35 PM |
Word Count/Unique Words | thesn00ze | Editor | 7 | 04-18-2019 06:36 AM |
1500 Words Per Hour: How To Write Faster, Better And More Easily | crich70 | Writers' Corner | 6 | 06-11-2014 11:27 AM |
How to dictionary with PDF format install in Kindle for look up words? | douxiaobo | Kindle Developer's Corner | 4 | 04-01-2012 09:10 AM |