mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-19 22:14:45 +02:00
Convert to bytes beforehand (#857)
This commit is contained in:
parent
7a5dd87385
commit
23d515c3e5
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user