Debian Bug report logs - #1012611
btop: Problems with rounding and locale when the string must be short. E.g. "1.87 GiB" -> " 1,0G"

version graph

Package: btop; Maintainer for btop is Marius Gripsgard <[email protected]>; Source for btop is src:btop (PTS, buildd, popcon).

Reported by: Marco Bodrato <[email protected]>

Date: Fri, 10 Jun 2022 09:51:02 UTC

Severity: minor

Found in version btop/1.2.7-1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Marius Gripsgard <[email protected]>:
Bug#1012611; Package btop. (Fri, 10 Jun 2022 09:51:04 GMT) (full text, mbox, link).


Acknowledgement sent to Marco Bodrato <[email protected]>:
New Bug report received and forwarded. Copy sent to Marius Gripsgard <[email protected]>. (Fri, 10 Jun 2022 09:51:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Marco Bodrato <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: btop: Problems with rounding and locale when the string must be short. E.g. "1.87 GiB" -> " 1,0G"
Date: Fri, 10 Jun 2022 11:42:14 +0200
Package: btop
Version: 1.2.7-1
Severity: minor

Dear Maintainer,

the use of locale by the program is not fully consistent.

The line "Load AVG:" is correct. I.e.:
$ LANG=C btop --utf-force
prints "Load AVG:   0.43   0.54   0.70" with dots ".";
$ LANG=eo btop --utf-force
prints "Load AVG:   0,43   0,54   0,70", the same with commas ",". 
Correct.

The size of memory or disks does not respect locale. E.g.:
$ LANG=C btop --utf-force
prints "72.9 Mi" or "1.86 GiB" with dots ".";
$ LANG=eo btop --utf-force
also prints "72.9 Mi" or "1.86 GiB", again with dots ".",
it should be with commas ",".

But the more important issue arises when the terminal size is small
and the program uses shorter forms. E.g.:
$ LANG=eo btop --utf-force
with a large terminal size prints "1.86 GiB", with dot;
the same value, with a small terminal size is printed as "1,0G",
with comma.
The problem is the digit: ",0" instead of ",9".
With LANG=C the program correctly prints "1.9G".

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.17.0-1-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=eo, LC_CTYPE=eo (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages btop depends on:
ii  libc6       2.33-7
ii  libgcc-s1   12.1.0-2
ii  libstdc++6  12.1.0-2

btop recommends no packages.

btop suggests no packages.

-- no debconf information

Ĝis,
m

-- 
http://bodrato.it/papers/



Information forwarded to [email protected], Marius Gripsgard <[email protected]>:
Bug#1012611; Package btop. (Tue, 05 Mar 2024 05:48:03 GMT) (full text, mbox, link).


Acknowledgement sent to Otto Kekäläinen <[email protected]>:
Extra info received and forwarded to list. Copy sent to Marius Gripsgard <[email protected]>. (Tue, 05 Mar 2024 05:48:03 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Otto Kekäläinen <[email protected]>
To: Marco Bodrato <[email protected]>, [email protected]
Subject: btop: Problems with rounding and locale when the string must be short. E.g. "1.87 GiB" -> " 1,0G"
Date: Mon, 4 Mar 2024 21:44:41 -0800
Hi Marco!

Thanks for reporting
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1012611 in Debian.

The bug you describe is not due to anything in the Debian packaging,
but most likely a common bug for upstream
https://github.com/aristocratos/btop.

Do you have experience in C++ development? Do you want to take a stab
in the open source spirit to fix this issue yourself?

This command-line tool is pretty simple, and building and rebuilding
it yourself while testing that your changes work is relatively trivial
if you have any C background.

If you end up submitting a PR upstream, please mark this Debian bug as
"Forwarded".



Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Mon Nov 11 14:17:54 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.