|
@@ 1442-1453 (lines=12) @@
|
| 1439 |
|
* #NUM! error value. |
| 1440 |
|
* @return string |
| 1441 |
|
*/ |
| 1442 |
|
public static function HEXTODEC($x) { |
| 1443 |
|
$x = PHPExcel_Calculation_Functions::flattenSingleValue($x); |
| 1444 |
|
|
| 1445 |
|
if (is_bool($x)) { |
| 1446 |
|
return PHPExcel_Calculation_Functions::VALUE(); |
| 1447 |
|
} |
| 1448 |
|
$x = (string) $x; |
| 1449 |
|
if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/',strtoupper($x),$out)) { |
| 1450 |
|
return PHPExcel_Calculation_Functions::NaN(); |
| 1451 |
|
} |
| 1452 |
|
return hexdec($x); |
| 1453 |
|
} // function HEXTODEC() |
| 1454 |
|
|
| 1455 |
|
|
| 1456 |
|
/** |
|
@@ 1575-1586 (lines=12) @@
|
| 1572 |
|
* #NUM! error value. |
| 1573 |
|
* @return string |
| 1574 |
|
*/ |
| 1575 |
|
public static function OCTTODEC($x) { |
| 1576 |
|
$x = PHPExcel_Calculation_Functions::flattenSingleValue($x); |
| 1577 |
|
|
| 1578 |
|
if (is_bool($x)) { |
| 1579 |
|
return PHPExcel_Calculation_Functions::VALUE(); |
| 1580 |
|
} |
| 1581 |
|
$x = (string) $x; |
| 1582 |
|
if (preg_match_all('/[01234567]/',$x,$out) != strlen($x)) { |
| 1583 |
|
return PHPExcel_Calculation_Functions::NaN(); |
| 1584 |
|
} |
| 1585 |
|
return octdec($x); |
| 1586 |
|
} // function OCTTODEC() |
| 1587 |
|
|
| 1588 |
|
|
| 1589 |
|
/** |