View Single Post
Old 01-21-2016, 02:46 PM   #19
fogice
Addict
fogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Timefogice possesses cleverness exceeding the boundaries of Space and Time
 
Posts: 262
Karma: 49504
Join Date: May 2014
Device: Kobo Libra 2
@chaley, thanks for your additional troubleshooting suggestions. Using 04.1f for all numbers does allow them to sort properly, so that takes that variable out of the equation. I'm using lina.w's final code, only tweaking the finish_formatting formula:
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')
);
Ideally, I would be using
Code:
final_sidx=finish_formatting(
    test(isInt, i, f),
    '',
    '',
    ': '
which would read
Series 02.5: Title
fogice is offline   Reply With Quote