Q:

PHP - converting hexdec value to version string

I'm working with an undocumented API that serves a version number as hexdec value.  I wish to convert this to the versioning string. 
Example
The API serves the following value: 117473280 (hexdec('7008000'))
This should be converted to the string: 7.00
I've made the following function to do this:
function getFirmwareFromDechex($dechex) {
    if(!empty($dechex) || $dechex ! == '0') {
        $dechex = dechex($dechex);
        $dechex = substr($dechex, 0, 3);
        $dechex = number_format($dechex / 100, 2);
            
        return $dechex;
    }
    
    return false;
}

echo getFirmwareFromDechex('117473280');

And this works.  However, when it has to convert version 10.00, it converts it to 1.00. 
How can I make the function compatible with higher version numbers such as 10.00? 
Update
After looking how the third party displays these versions on their website, it does seem I need to pad the number to the left with a 0. 

A:

I think the hex string should be 8 bytes long, so pad the start with 0's (str_pad() with STR_PAD_LEFT) and then take the first 4 characters...
function getFirmwareFromDechex($dechex) {
    if(!empty($dechex) || $dechex ! == '0') {
        $dechex = str_pad(dechex($dechex), 8, 0, STR_PAD_LEFT);
        $dechex = substr($dechex, 0, 4);
        $dechex = number_format($dechex / 100, 2);

        return $dechex;
    }

    return false;
}

