You are here

public static function PHPExcel_Calculation::_wrapResult in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php \PHPExcel_Calculation::_wrapResult()

* Wrap string values in quotes * *

Parameters

mixed $value: * @return mixed

10 calls to PHPExcel_Calculation::_wrapResult()
PHPExcel_Calculation::_calculateFormulaValue in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php
* Parse a cell formula and calculate its value * *
PHPExcel_Calculation::_parseFormula in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php
PHPExcel_Calculation::_processTokenStack in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php
PHPExcel_Calculation_Database::__filter in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Database.php
* __filter * * Parses the selection criteria, extracts the database rows that match those criteria, and * returns that subset of rows. * * @access private *
PHPExcel_Calculation_Functions::_ifCondition in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/Functions.php

... See full list

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation.php, line 2163

Class

PHPExcel_Calculation
PHPExcel_Calculation (Multiton)

Code

public static function _wrapResult($value) {
  if (is_string($value)) {

    //	Error values cannot be "wrapped"
    if (preg_match('/^' . self::CALCULATION_REGEXP_ERROR . '$/i', $value, $match)) {

      //	Return Excel errors "as is"
      return $value;
    }

    //	Return strings wrapped in quotes
    return '"' . $value . '"';

    //	Convert numeric errors to NaN error
  }
  else {
    if (is_float($value) && (is_nan($value) || is_infinite($value))) {
      return PHPExcel_Calculation_Functions::NaN();
    }
  }
  return $value;
}