Example #1
0
 /**
  * Convert a number token to ptgInt or ptgNum
  *
  * @access private
  * @param mixed $num an integer or double for conversion to its ptg value
  */
 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);
     } else {
         // A float
         if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) {
             // if it's Big Endian
             $num = strrev($num);
         }
         return pack("Cd", $this->ptg['ptgNum'], $num);
     }
 }
Example #2
0
 /**
  * Store the BOTTOMMARGIN BIFF record.
  */
 private function _writeMarginBottom()
 {
     $record = 0x29;
     // Record identifier
     $length = 0x8;
     // Bytes to follow
     $margin = $this->_phpSheet->getPageMargins()->getBottom();
     // Margin in inches
     $header = pack("vv", $record, $length);
     $data = pack("d", $margin);
     if (PHPExcel_Writer_Excel5_BIFFwriter::getByteOrder()) {
         // if it's Big Endian
         $data = strrev($data);
     }
     $this->_append($header . $data);
 }