Closed Krik658 closed 4 months ago
@Krik658 What does this show?
free -b
LC_ALL=C.UTF-8 free -b
I'm sorry. This issue is a duplicate of #7107 and that was already fixed in the new version. I didn't see that before. :(
I also have the German locale which is the cause of the issue.
Duplicate of #7107 Didn't see that before :(
Creating a bug report/issue
Required Information
DietPi version |
cat /boot/dietpi/.version
Distro version |
echo $G_DISTRO_NAME $G_RASPBIAN
Kernel version |
uname -a
SBC model |
echo $G_HW_MODEL_NAME
or (EG: RPi3)Intel N100 MiniPC with 16 GB RAM
Additional Information (if applicable)
Steps to reproduce
Login via ssh. Read memory info.
Expected behaviour
It should always show 15.75 GB (w/o video memory in my case)
Actual behaviour
The conversion of numbers leads to garbled output.
Extra details
The error is in https://github.com/MichaIng/DietPi/blob/master/dietpi/func/dietpi-banner, line 259. I think the values are too big to be displayed correctly.
Original:
free -b | mawk 'NR==2 {CONVFMT="%.0f"; print $3/1024^2" of "$2/1024^2" MiB ("$3/$2*100"%)"}'
Output:13355 of 1747 MiB (765%)
Possible solutions
Human readable format, converts to Mi or Gi depending on values but there's no space between value and unit Code:
free -h | mawk 'NR==2 {CONVFMT="%.0f"; print $3" of "$2" ("$3/$2*100"%)"}'
Output:1,7Gi of 15Gi (11%)
Or force MiB, looks pretty enough Code:
free -m | mawk 'NR==2 {CONVFMT="%.0f"; print $3" MiB of "$2" MiB ("$3/$2*100"%)"}'
Output:1725 MiB of 15770 MiB (11%)
I assume the
-h
and-m
parameters are available on the arm version offree
but I don't know that for sure.