[SOLVED] %CPU load format from top, decimal point issue

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
s_k
Level 1
Level 1
Posts: 10
Joined: Mon May 04, 2020 6:32 am

[SOLVED] %CPU load format from top, decimal point issue

Post by s_k »

I recently installed MINT 20.2 and I just discovered that the output from top is slightly different, namely that comma (,) is used as a decimal point instead of punctuation (.). Worse, this setting bleeds through to my work server when I ssh from my MINT to work, then the server at work then also uses , as decimal point in top output. This caused a script which parses the output from top to fail. In other words, it somehow sniffed out that I run from home and then apply settings from my MINT to the server environment at work (gasp). I ran MINT 19.3 before without this problem.

I see that for example in the MINT file browser it uses comma as decimal point when showing file sizes (e.g. "19,3kB"). I live in Denmark, which uses comma, but I did set Language and Date and Time format to United States on my MINT. So why does it still use comma?

How can I fix this?

And how can I ensure that absolutely nothing like this bleeds through my ssh to work servers, I obviously never want that, and I can't imagine who does?

Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
mikeflan
Level 17
Level 17
Posts: 7155
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: %CPU load format from top, decimal point issue

Post by mikeflan »

I just discovered that the output from top is slightly different, namely that comma (,) is used as a decimal point instead of punctuation (.).
I don't see that. This is my locale:

Code: Select all

$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
$
s_k
Level 1
Level 1
Posts: 10
Joined: Mon May 04, 2020 6:32 am

Re: %CPU load format from top, decimal point issue

Post by s_k »

I figured out that my LC_NUMERIC was set to German I believe it was, I did:

sudo update-locale LC_NUMERIC="en_GB.UTF-8"

And it fixed the problem. I have no idea why it didn't use US/English locale to begin with, I selected US/English already during the install, but I did select DK keyboard layout and Berlin time zone.

This article article explains it:

https://adrian.frith.dev/decimal-comma-ubuntu/

Regarding the disturbing fact that my local MINT config affects how scripts run on a Linux server I log into at work, I can only assume that it may be caused by X-forwarding over ssh, which I use.
Locked

Return to “Software & Applications”