Convert to bytes beforehand (#857)

This commit is contained in:
Lance Pioch 2025-01-04 12:34:26 -05:00 committed by GitHub
parent 7a5dd87385
commit 23d515c3e5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -473,6 +473,11 @@ class Server extends Model
return Number::format($resourceAmount, precision: $precision, locale: auth()->user()->language ?? 'en') . '%';
}
// Our current limits are set in MB
if ($limit) {
$resourceAmount *= 2 ** 20;
}
return convert_bytes_to_readable($resourceAmount, decimals: $precision, base: 3);
}