numfmt: support lowercase 'k' for Kilo and Kibi
commit615167cc4d88ab94c0e6f804ccc0787febf7cd0e
authorPádraig Brady <P@draigBrady.com>
Sun, 26 Nov 2023 16:41:56 +0000 (26 16:41 +0000)
committerPádraig Brady <P@draigBrady.com>
Mon, 27 Nov 2023 19:41:49 +0000 (27 19:41 +0000)
tree7b1ee1b570239954f530954519dec61eb991cb82
parent74b9d6a6e872553dcebfc41f8cb962d5d85d77e5
numfmt: support lowercase 'k' for Kilo and Kibi

For consistency with the "SI" standard, and with other coreutils
which output a lowercase 'k' in "SI" mode.

* src/numfmt.c (suffix_power): Treat 'k' like 'K' on input.
(double_to_human): Output lowercase 'k' in SI mode.
(usage): Adjust accordingly.
* doc/coreutils.texi: Mention 'k' accepted, and printed in SI mode.
* tests/misc/numfmt.pl: Adjust accordingly.
* NEWS: Mention the change in behavior.
Fixes https://bugs.gnu.org/47103
NEWS
doc/coreutils.texi
src/numfmt.c
tests/misc/numfmt.pl