[Koha-devel] Should the first 3 digits of cn_sort be sorted for dewey decimal?

Michael Kuhn mik at adminkuhn.ch
Sat Jun 16 08:37:10 CEST 2018


Hi Barton

 > this means that callnumbers
 >
 > 9.1 => 9_100000000000000
 > 80.1 => 80_100000000000000
 > 700.1 => 700_100000000000000
 >
 > when sorted ascending by cn_sort
 >
 > 700.1 => 700_100000000000000
 > 80.1 =>  80_100000000000000
 > 9.1 => 9_100000000000000
 >
 > Shouldn't these be zero padded to 3 digits, so that they sort as
 > follows?
 >
 > 009_100000000000000
 > 080_100000000000000
 > 700_100000000000000

Dewey Decimal Classification uses characters that indeed do look like 
Arabic numbers (standing for classes, divisions, sections), but these 
characters do not behave like numbers, so the correct sorting is 
actually not as you would expect (namely seen from the right to left)

   1
   2
  11
  21
100
230

but (and thus seen from left to right)

1
100
11
2
21
230

Hope this helps.

Best wishes: Michael
-- 
Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis
Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz
T 0041 (0)61 261 55 61 · E mik at adminkuhn.ch · W www.adminkuhn.ch


More information about the Koha-devel mailing list