GNU bug report logs - #47103
numfmt: invalid suffix 'k'

Previous Next

Package: coreutils;

Reported by: Daniel Callejas Sevilla <daniel.callejas.sevilla <at> gmail.com>

Date: Fri, 12 Mar 2021 16:18:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Daniel Callejas Sevilla <daniel.callejas.sevilla <at> gmail.com>
Subject: bug#47103: closed (Re: bug#47103: numfmt: invalid suffix 'k')
Date: Sun, 26 Nov 2023 17:00:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#47103: numfmt: invalid suffix 'k'

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 47103 <at> debbugs.gnu.org.

-- 
47103: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47103
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Pádraig Brady <P <at> draigBrady.com>
To: Sven Köhler <sven.koehler <at> gmail.com>,
 47103-done <at> debbugs.gnu.org
Subject: Re: bug#47103: numfmt: invalid suffix 'k'
Date: Sun, 26 Nov 2023 16:59:36 +0000
[Message part 3 (text/plain, inline)]
On 26/11/2023 16:09, Sven Köhler wrote:
> So Pádraig's patch does allow for parsing lowercase k, but it does not
> change numfmt to use lowercase k in its output in si mode.
> 
> As Pádraig has shown, ls uses lowercase k in --si mode. So it uses
> lowercase k for 1000. I think that numfmt should behave the same for
> consistency reasons.

It does output lowercase 'k' in SI mode.

Attached is the full patch.

Marking this as done.

Will push this tomorrow.

thanks,
Pádraig
[numfmt-k.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Daniel Callejas Sevilla <daniel.callejas.sevilla <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: numfmt: invalid suffix 'k'
Date: Fri, 12 Mar 2021 17:12:13 +0100
Hello,

the SI prefix for 'a thousand' is a lowercase k and not an uppercase K [1].

The default behavior of numfmt with '--from=si' option is therefore
contrary to expectation:

$ numfmt --from=si
 500k    # Should be accepted as valid SI
 numfmt: invalid suffix in input: ‘500k’

$ numfmt --from=si
 500K    # Should result in error, 'K' stands for kelvin unit.
 500000

$ numfmt --version
 numfmt (GNU coreutils) 8.26
 Packaged by Cygwin (8.26-2)
 Copyright (C) 2016 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.

 Written by Assaf Gordon.


Best regards,
Daniel.

[1] Page 143 of https://www.bipm.org/en/publications/si-brochure/



This bug report was last modified 1 year and 179 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.