|
From: | Paul Eggert |
Subject: | bug#21000: coreutils 8.24 sort -h gets ordering wrong |
Date: | Tue, 07 Jul 2015 08:27:42 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
Christopher Samuel wrote:
it appears that this ordering is derived purely on an ordering of the suffixes rather than doing any form of conversion.
It's not purely the suffixes; it looks at suffixes first, and looks at the numbers if the suffixes are equal.
Looking at both would require arbitrary-precision arithmetic, something that 'sort' doesn't do (it does only arbitrary-precision comparison). It would also require knowing whether the base was 1000 or 1024. Bit of a hassle, that.
numfmt is a workaround, but has rounding problems.
[Prev in Thread] | Current Thread | [Next in Thread] |