Correct issue with 2 digit instead of one in Glances UI MEM

This commit is contained in:
nicolargo 2025-10-24 19:22:57 +02:00
parent 7edbab35d8
commit 6361217258
4 changed files with 5 additions and 4 deletions

View File

@ -110,7 +110,7 @@ export default {
return this.data.views['mem'];
},
percent() {
return this.stats['percent'].toFixed(2);
return this.stats['percent'].toFixed(1);
},
total() {
return this.stats['total'];

File diff suppressed because one or more lines are too long

View File

@ -136,7 +136,7 @@ class QuicklookPlugin(GlancesPluginModel):
mem_available + zfs_cache_stats.get('arcstats.size', 0) - zfs_cache_stats.get('arcstats.c_min', 0)
)
stats['mem'] = float((mem_total - mem_available) / mem_total * 100)
stats['mem'] = round(float((mem_total - mem_available) / mem_total * 100), 1)
try:
stats['swap'] = psutil.swap_memory().percent
except RuntimeError:
@ -320,3 +320,4 @@ class QuicklookPlugin(GlancesPluginModel):
def _mhz_to_hz(self, hz):
"""Convert Mhz to Hz."""
return hz * 1000000.0
return hz * 1000000.0

View File

@ -1,5 +1,5 @@
name: glances
version: '4.4.0+build01' # Put the current stable version+buildXX (00 for beta/develop)
version: '4.4.0+build02' # Put the current stable version+buildXX (00 for beta/develop)
summary: Glances an Eye on your system. A top/htop alternative.
description: |