Numeric Sorting (Was: Sort Bug?)

Not what I expected.

Regards, AB

Numeric sorting, innit.

You can turn off numeric sorting via Folder Formats, on the Display tab, in the Sorting section.

Leo, thanks for the pointer to where this option is set. Is numeric sorting the default? I don't remember setting this manually but it's certainly possible that I did at some point in the dim and distant past.

The Help file simply says that..

"Numeric order filename sorting: Sorts numbers numerically rather than alphabetically. This ensures that files beginning or ending with numbers will sort in their correct order. For example, 1, 2, 10 would be sorted in this order rather than 1, 10, 2."

Where can I find a description of the numeric sorting algorithm DOpus uses?

Regards, AB

It is on by default, yep.

You quoted the description of the algorithm. :slight_smile:

When comparing two names, if they both start with a number then those numbers will be compared numerically rather than as strings. (If the numbers at the start are the same then the rest of the filename will be considered.)

If two names have the same prefix and then end with a number, those numbers will be compared numerically.

AFAIK that's all there is to it. It's usually most welcome but can also produce results you wouldn't expect at times. Explorer does a similar thing (or at least does in Windows 7; not sure when it started doing that). The two programs may even use the same OS API for sorting filenames; not sure.

[quote="leo"]It is on by default, yep.

You quoted the description of the algorithm. :slight_smile:[/quote]
As you suggested, it looks like DOpus and Explorer use the same code and it's good to know that DOpus allows this feature to be switched off. Whilst I can see the attraction of the 1, 2, 10 thing I'm failing miserably to fathom the logic that results in the order shown in my original post.

Thanks to your pointer, I have switched off numeric sorting for all formats and will create one with it switched on to be used as required.

Regards, AB

1988 is a smaller number than 19840101

Amazing how obscure the bleeding obvious can be, at times.... :smiley:

Thanks, AB