View Single Post
Old 12-23-2019, 10:19 AM   #1
TheRealAce
Junior Member
TheRealAce began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2019
Device: Kindle Basic 10th gen
Issues with decimal numbers sorting + sorting series but showing title first

Dear E-readers,

this is a 2-part question, I hope that's okay.


First, for some reason the Kindle doesn't sort decimal number correctly when displayed like this:

Code:
program:

sidx=field('series_index');
i=format_number(sidx, "{:02d}");
f=format_number(sidx, "{:04.1f}");
isInt=cmp(f, i, '', 'yes', '');
final_sidx=finish_formatting(
    test(isInt, i, f),
    '',
    ' [',
    '] '
);

# Add together the final result
strcat(
    field('series'),
    final_sidx,
    field('title')
);
Stormlight Archive [01] - Way of Kings
Stormlight Archive [02.5] - Edgedancer
Stormlight Archive [02] - Words of Radiance


After an extensive search I concluded it's not possible because of the number/symbol order programmed in Kindle itself. However, the threads and articles I read where at least 2 years old, some older.
Has there been an update and/or is it fixable with the current version?

To clarify, I did get it to sort correctly with:

Code:
{series} {series_index:04.1f|[|] }{title}
but then it shows all numbers with a .0 like so:

Stormlight Archive [01.0] - Way of Kings
Stormlight Archive [02.0] - Words of Radiance
Stormlight Archive [02.5] - Edgedancer


and that applies to other series without decimals as well.
Apologies for sounding like a total OCD freak, but this is not quite what I want.


Second, nothing major but, I'd like to sort my series on the series name and number but with the title showing first, like this:


Way of Kings - Stormlight Archive [01]
Words of Radiance - Stormlight Archive [02]
Oathbringer - Stormlight Archive [03]


But when putting title first, it of course sorts on title alphabetically:

Oathbringer - Stormlight Archive [03]
Way of Kings - Stormlight Archive [01]
Words of Radiance - Stormlight Archive [02]


Is it possible to have title show first but still sort on series?


Any help or advice would be greatly appreciated, apologies again for the nitpicking. If it's not solvable I guess I'd have to choose between ugly numbers or wrong sorting.

BTW: I have a Kindle Basic 10th gen 6" and Calibre 4.6

TheRealAce is offline   Reply With Quote