'I have problems with PHP and Laravel code

I have a problem because this is not a clean solution how I calculate the things. Storage should be calculated in GB and Memory in MB I get values like "free" => 98807345152 from the respective Storage and Memory. What is a better solution?

I don't like the calculations there.

$nodeMemory = GetNodeMemoryStatusAction::run('node01');
    $nodeStorage = GetNodeStorageStatusAction::run('node01');

    if (number_format($nodeMemory['free'] / 1024 / 1024, 0, ',', '') >= $this->data['memory']
        && number_format($nodeStorage['free'] / 1024 / 1024, 0, ',', '') >= $this->data['storage'] / 1024) {
    }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source