![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,013
Karma: 251649
Join Date: Apr 2010
Location: Tempe, AZ, USA, Earth
Device: JetBook Lite (away from home) + 1 spare, 32" TV (at home)
|
Format for Numbers in Custom Column
I'm trying to make a custom column for numbers assigned to books (not series numbers). The numbers can range from 1-999. It appears "Integers" is the column type I need to use but I have no clue what to put in "Format for numbers". I need the column to be right aligned and would prefer not to have to use leading zeros for proper sorting.
I want the column to look like something like this before sorting (only right justified; the forum software wouldn't let me put in leading spaces to emulate right justification): 9 13 10 1 109 243 And something this after sorting (again, only right justified): 1 9 10 13 109 243 I tried to figure out the Python documentation but I might as well had been reading Sanskrit. Can anyone tell me what I need to put in the "Format for numbers" field? Last edited by Lady Fitzgerald; 09-16-2013 at 05:48 AM. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,837
Karma: 7030035
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Do you want it right-aligned on calibre's spreadsheet? if so, put nothing in the format. Instead. right-click on the column header, choose "Change text alignment ...", and select "Right".
Integer columns will sort numerically no matter how they are aligned. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,072
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Lady F
The sort you show appears to be an Alpha sorted (text field): eg. 1 10 100 2 20 The only way a Text field will sort numerics is to use a leading character from the ASCII chart below Chr 48 (zero), Space being Chr 32 |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,013
Karma: 251649
Join Date: Apr 2010
Location: Tempe, AZ, USA, Earth
Device: JetBook Lite (away from home) + 1 spare, 32" TV (at home)
|
Ok, the justification issue is settled (that was a "duh!" moment). I discovered a problem with using an integer column. It sorts the numbers the way I want without the use of leading zeros (the leading zeros look junky and make reading a list of numbers harder) but, once I click on a row in the column, it will insert a zero and won't let me delete it. Same if if I put in a number in a row; I can't delete it. Adding insult to injury, if I, say, enter 112, then want to change it to 212, I would have to scroll thought every number between; it won't just let me highlight the number and change it.
Any ideas on how to deal with this? |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,837
Karma: 7030035
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
To return a cell to undefined, enter -100000 (negative one million). Last edited by chaley; 09-16-2013 at 02:59 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,013
Karma: 251649
Join Date: Apr 2010
Location: Tempe, AZ, USA, Earth
Device: JetBook Lite (away from home) + 1 spare, 32" TV (at home)
|
Ok, I couldn't tell that pressing F2 did anything other than set there and laugh at me. For some reason, the field is now allowing me to highlight and change the number to another, even before I played with F2. I don't what caused it but I firmly believe in, "If it ain't broke, don't fix it." Also, the -1000000 trick works for deleting an accidental entry; odd that but whatever works...
Thanks for all your help! |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom column returns value based on value of another custom column? | calvin-c | Calibre | 3 | 09-14-2013 02:24 PM |
Custom yes/no column built from long text column | Philantrop | Library Management | 7 | 03-23-2013 07:44 PM |
Custom Column - Book Format (ie mobi, epub etc) | jphphotography | Calibre | 3 | 01-17-2011 12:34 AM |
Custom Column Format | aceflor | Calibre | 5 | 12-10-2010 10:28 AM |
create custom format column | blaubach | Calibre | 12 | 09-17-2010 03:22 PM |