From dff0a8ca476eb42f2da46f55d5f61a4293529d3c Mon Sep 17 00:00:00 2001 From: nekohepott Date: Wed, 17 Jun 2026 04:16:36 +0300 Subject: [PATCH] refactor: round up ram to 2 decimals --- src/providers/systemstats.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/providers/systemstats.go b/src/providers/systemstats.go index cf63c75..3df700b 100644 --- a/src/providers/systemstats.go +++ b/src/providers/systemstats.go @@ -48,9 +48,9 @@ func GetDist() (string, string) { func getSizeRam(total, avaible, used *int) string { if *total >= 1024*1024 && *avaible >= 1024*1024 { *used = *total - *avaible - usedGiB := *used / (1024 * 1024) - totalGiB := *total / (1024 * 1024) - ram := fmt.Sprintf("%d / %d Gi", usedGiB, totalGiB) + usedGiB := float64(*used) / (1024 * 1024) + totalGiB := float64(*total) / (1024 * 1024) + ram := fmt.Sprintf("%.2f / %.2f GiB", usedGiB, totalGiB) ram = strings.TrimSpace(ram) return ram