Rockbox mail archiveSubject: Re: how is strnatcmp aka "Interpret numbers while sorting" supposed to sort?
Re: how is strnatcmp aka "Interpret numbers while sorting" supposed to sort?
From: Al Le <al.le_at_gmx.de>
Date: Thu, 19 Mar 2009 22:57:24 +0100
On 19.03.2009 00:13, Paul Louden wrote:
> Al Le wrote:
> My personal position is also that if a user adds a 0 before a number,
> they expect it to change something, rather than being ignored. I think,
> on average, more 0s (in lists meant to be sorted) will be intentional
> than "accidental."
Paul, I think we can agree that there are different cases. There are
cases where a leading zero is intentional and there are cases where it's
just there (because you used a wrong setting in the ripping software or
because you copied the file from somewhere else). The problem is that a
single "natural" sort won't fit all. Maybe we should have two natural
sort procedures? One would ignore the leading zeroes, i.e. just consider
numbers as in mathematics (it would put "007" after "6") and the other
wouldn't (it would put "007" before "6").
The major file browsers (since produced by a techies :-) operate on just
numbers, without special treatment of the leading zeroes.
Received on 2009-03-19