Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-16-2013, 05:45 AM   #1
Lady Fitzgerald
Wizard
Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.
 
Lady Fitzgerald's Avatar
 
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.
Lady Fitzgerald is offline   Reply With Quote
Old 09-16-2013, 06:57 AM   #2
chaley
Grand Sorcerer
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: 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.
chaley is offline   Reply With Quote
Advert
Old 09-16-2013, 08:53 AM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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
theducks is online now   Reply With Quote
Old 09-16-2013, 02:19 PM   #4
Lady Fitzgerald
Wizard
Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.
 
Lady Fitzgerald's Avatar
 
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?
Lady Fitzgerald is offline   Reply With Quote
Old 09-16-2013, 02:52 PM   #5
chaley
Grand Sorcerer
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: 11,837
Karma: 7030035
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Lady Fitzgerald View Post
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?
If I click on a int cell and press F2 to edit it (I have turned off click-to-edit), I can type any number I want. If I hit escape, the editor closes without changing the cell, even if I had typed in it or even if it changed from empty to the initial zero. If when I click on the cell it contains, for example, 259, that number is selected and it is erased when I type something. If I am editing a cell and type Ctrl-A, all the contents are selected and the next thing I type overwrites it all. Are you saying that none of this works for you? Edit: I re-enabled click-to-edit and it behaves the same.

To return a cell to undefined, enter -100000 (negative one million).

Last edited by chaley; 09-16-2013 at 02:59 PM.
chaley is offline   Reply With Quote
Advert
Old 09-16-2013, 03:27 PM   #6
Lady Fitzgerald
Wizard
Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.Lady Fitzgerald ought to be getting tired of karma fortunes by now.
 
Lady Fitzgerald's Avatar
 
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!
Lady Fitzgerald is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 09:20 AM.


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