fix: Wrong conversion if decimal prefix selected (#1626)

Co-authored-by: Boy132 <Boy132@users.noreply.github.com>
This commit is contained in:
SaurFort 2025-08-31 13:51:27 +02:00 committed by GitHub
parent 0104a08ba4
commit 76451fa0ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -67,7 +67,7 @@ class ServerOverview extends StatsOverviewWidget
}
$latestMemoryUsed = collect(cache()->get("servers.{$this->server->id}.memory_bytes"))->last(default: 0);
$totalMemory = $this->server->memory * 2 ** 20;
$totalMemory = $this->server->memory * (config('panel.use_binary_prefix') ? 1024 * 1024 : 1000 * 1000);
$used = convert_bytes_to_readable($latestMemoryUsed);
$total = convert_bytes_to_readable($totalMemory);