bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#51011: [GNU sort] Numerical sort with delimiter may be broken (bug)


From: Paul Eggert
Subject: bug#51011: [GNU sort] Numerical sort with delimiter may be broken (bug)
Date: Fri, 8 Oct 2021 13:48:17 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/8/21 6:37 AM, Pádraig Brady wrote:

The difference here is due to ',' being treated as a thousands sep,
not a decimal point.

Oh, thanks. Of course! I should have figured that out myself.

It is unfortunate that "," is treated as a thousands seperator even though it's obviously not one (as it's not followed by 3 decimal digits). I don't think POSIX requires this behavior; it's not clear to me that POSIX even allows it.

This bug report suggests that we should alter the code so that 'sort -n' acts more like common practice, and requires thousands separators to be in the right places in order to treat nearby digits to be part of the number. Alternatively, we could document the existing behavior (even if it's not clear that it conforms to POSIX).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]