mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-26 15:26:03 +03:00
Trap for scientific format masks with "0" or "#" before the "E"
This commit is contained in:
parent
bff907a1b8
commit
f86458630f
@ -283,7 +283,7 @@ class PHPExcel_Shared_Date
|
|||||||
if (strtolower($pFormatCode) === strtolower(PHPExcel_Style_NumberFormat::FORMAT_GENERAL))
|
if (strtolower($pFormatCode) === strtolower(PHPExcel_Style_NumberFormat::FORMAT_GENERAL))
|
||||||
// "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
|
// "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (preg_match('/0E[+-]0/i', $pFormatCode)) {
|
if (preg_match('/[0#]E[+-]0/i', $pFormatCode))
|
||||||
// Scientific format
|
// Scientific format
|
||||||
return FALSE;
|
return FALSE;
|
||||||
// Switch on formatcode
|
// Switch on formatcode
|
||||||
|
@ -673,7 +673,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
|
|||||||
);
|
);
|
||||||
$value = preg_replace($number_regex, $value, $format);
|
$value = preg_replace($number_regex, $value, $format);
|
||||||
} else {
|
} else {
|
||||||
if (preg_match('/0E[+-]0/i', $format)) {
|
if (preg_match('/[0#]E[+-]0/i', $format)) {
|
||||||
// Scientific format
|
// Scientific format
|
||||||
$value = sprintf('%5.2E', $value);
|
$value = sprintf('%5.2E', $value);
|
||||||
} elseif (preg_match('/0([^\d\.]+)0/', $format)) {
|
} elseif (preg_match('/0([^\d\.]+)0/', $format)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user