CALCULATION_REGEXP_NUMBER
CALCULATION_REGEXP_NUMBER = '[-+]?\d*\.?\d+(e[-+]?\d+)?'
PHPExcel_Calculation (Multiton)
Copyright (c) 2006 - 2015 PHPExcel
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
$instance : \PHPExcel_Calculation
Instance of this class
$workbook : \PHPExcel
Instance of the workbook this Calculation Engine is using
$workbookSets : array<mixed,\PHPExcel_Calculation>
List of instances of the calculation engine that we've instantiated for individual workbooks
$debugLog : \PHPExcel_CalcEngine_Logger
The debug log generated by the calculation engine
__construct(\PHPExcel $workbook = null)
\PHPExcel | $workbook |
getInstance(\PHPExcel $workbook = null) : \PHPExcel_Calculation
Get an instance of this class
\PHPExcel | $workbook | Injected workbook for working with a PHPExcel object, or NULL to create a standalone claculation engine |
getDebugLog() : \PHPExcel_CalcEngine_Logger
Get the debuglog for this claculation engine instance
calculate(\PHPExcel_Cell $pCell = null) : mixed
Calculate cell value (using formula from a cell ID) Retained for backward compatibility
\PHPExcel_Cell | $pCell | Cell to calculate |
calculateCellValue(\PHPExcel_Cell $pCell = null, Boolean $resetLog = true) : mixed
Calculate the value of a cell formula
\PHPExcel_Cell | $pCell | Cell to calculate |
Boolean | $resetLog | Flag indicating whether the debug log should be reset or not |
calculateFormula(string $formula, string $cellID = null, \PHPExcel_Cell $pCell = null) : mixed
Calculate the value of a formula
string | $formula | Formula to parse |
string | $cellID | Address of the cell to calculate |
\PHPExcel_Cell | $pCell | Cell to calculate |
_calculateFormulaValue(string $formula, string $cellID = null, \PHPExcel_Cell $pCell = null) : mixed
Parse a cell formula and calculate its value
string | $formula | The formula to parse and calculate |
string | $cellID | The ID (e.g. A3) of the cell that we are calculating |
\PHPExcel_Cell | $pCell | Cell to calculate |
extractCellRange( $pRange = 'A1', \PHPExcel_Worksheet $pSheet = null, boolean $resetLog = true) : mixed
Extract range values
$pRange | ||
\PHPExcel_Worksheet | $pSheet | Worksheet |
boolean | $resetLog | Flag indicating whether calculation log should be reset or not |
Array of values in range if range contains more than one element. Otherwise, a single value is returned.
extractNamedRange( $pRange = 'A1', \PHPExcel_Worksheet $pSheet = null, boolean $resetLog = true) : mixed
Extract range values
$pRange | ||
\PHPExcel_Worksheet | $pSheet | Worksheet |
boolean | $resetLog | Flag indicating whether calculation log should be reset or not |
Array of values in range if range contains more than one element. Otherwise, a single value is returned.
checkMatrixOperands( $operand1, $operand2, integer $resize = 1)
Ensure that paired matrix operands are both matrices and of the same size
$operand1 | ||
$operand2 | ||
integer | $resize | Flag indicating whether the matrices should be resized to match and (if so), whether the smaller dimension should grow or the larger should shrink. 0 = no resize 1 = shrink to fit 2 = extend to fit |
resizeMatricesShrink( $matrix1, $matrix2, integer $matrix1Rows, integer $matrix1Columns, integer $matrix2Rows, integer $matrix2Columns)
Ensure that paired matrix operands are both matrices of the same size
$matrix1 | ||
$matrix2 | ||
integer | $matrix1Rows | Row size of first matrix operand |
integer | $matrix1Columns | Column size of first matrix operand |
integer | $matrix2Rows | Row size of second matrix operand |
integer | $matrix2Columns | Column size of second matrix operand |
resizeMatricesExtend( $matrix1, $matrix2, integer $matrix1Rows, integer $matrix1Columns, integer $matrix2Rows, integer $matrix2Columns)
Ensure that paired matrix operands are both matrices of the same size
$matrix1 | ||
$matrix2 | ||
integer | $matrix1Rows | Row size of first matrix operand |
integer | $matrix1Columns | Column size of first matrix operand |
integer | $matrix2Rows | Row size of second matrix operand |
integer | $matrix2Columns | Column size of second matrix operand |
_parseFormula( $formula, \PHPExcel_Cell $pCell = null)
$formula | ||
\PHPExcel_Cell | $pCell |
processTokenStack( $tokens, $cellID = null, \PHPExcel_Cell $pCell = null)
$tokens | ||
$cellID | ||
\PHPExcel_Cell | $pCell |
strcmpLowercaseFirst(string $str1, string $str2) : integer
Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters
string | $str1 | First string value for the comparison |
string | $str2 | Second string value for the comparison |