Pantheon\Terminus\Models\Backup::getSizeInMb PHP Method

getSizeInMb() public method

Returns the size of the backup in MB
public getSizeInMb ( ) : string
return string A number (an integer or a float) followed by 'MB'.
    public function getSizeInMb()
    {
        $size_string = '0';
        if ($this->get('size') != null) {
            $size = $this->get('size') / 1048576;
            if ($size > 0.1) {
                $size_string = sprintf('%.1fMB', $size);
            } elseif ($size > 0) {
                $size_string = '0.1MB';
            }
        }
        return $size_string;
    }