Skip to content

Commit

Permalink
format after math
Browse files Browse the repository at this point in the history
  • Loading branch information
Boy132 committed Jan 19, 2025
1 parent 03eaddb commit c531707
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ class NodeStorageChart extends ChartWidget

protected function getData(): array
{
$total = Number::format(config('panel.use_binary_prefix')
$total = config('panel.use_binary_prefix')
? ($this->node->statistics()['disk_total'] ?? 0) / 1024 / 1024 / 1024
: ($this->node->statistics()['disk_total'] ?? 0) / 1000 / 1000 / 1000, maxPrecision: 2);
$used = Number::format(config('panel.use_binary_prefix')
: ($this->node->statistics()['disk_total'] ?? 0) / 1000 / 1000 / 1000;
$used = config('panel.use_binary_prefix')
? ($this->node->statistics()['disk_used'] ?? 0) / 1024 / 1024 / 1024
: ($this->node->statistics()['disk_used'] ?? 0) / 1000 / 1000 / 1000, maxPrecision: 2);
: ($this->node->statistics()['disk_used'] ?? 0) / 1000 / 1000 / 1000;

$unused = $total - $used;

$used = Number::format($used, maxPrecision: 2);
$unused = Number::format($unused, maxPrecision: 2);

return [
'datasets' => [
[
Expand Down

0 comments on commit c531707

Please sign in to comment.