View Single Post
Old 05-18-2020, 08:44 PM   #1
eosrose
Enthusiast
eosrose began at the beginning.
 
Posts: 45
Karma: 14
Join Date: May 2010
Location: WI
Device: Kobo Forma
Rounding Word Counts in a Custom Column

I have the following custom column setup to collect word counts:
Lookup name: words
Column heading: Words
Column type: integers
Format for numbers: {:n}

I would like to create another custom column based on this column to include a word count rounded to the nearest 1,000 and with the decimal shifted over 3 spaces:
Words: 560 =becomes=> 1k
Words: 15,400 =becomes=> 15k

Is this even possible? I tried looking at the Python documentation for the format language and my eyes started to cross. I'm pretty comfortable with PHP and I'm starting to understand RegEX, but it appears Python is outside my grasp.
eosrose is offline   Reply With Quote