code: private function convertNumber($num)
      {
          // Integer in the range 0..2**16-1
          if ((preg_match('/^\\d+$/', $num)) and ($num <= 65535)) {
              return pack('Cv', $this->ptg['ptgInt'], $num);
          }
  
          // A float
          if (BIFFwriter::getByteOrder()) { // if it's Big Endian
              $num = strrev($num);
          }
  
          return pack('Cd', $this->ptg['ptgNum'], $num);
      }
docs: Convert a number token to ptgInt or ptgNum.
  
  @param mixed $num an integer or double for conversion to its ptg value
  
  @return string