mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-22 21:36:05 +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))
|
||||
// "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
|
||||
return FALSE;
|
||||
if (preg_match('/0E[+-]0/i', $pFormatCode)) {
|
||||
if (preg_match('/[0#]E[+-]0/i', $pFormatCode))
|
||||
// Scientific format
|
||||
return FALSE;
|
||||
// Switch on formatcode
|
||||
|
@ -673,7 +673,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
|
||||
);
|
||||
$value = preg_replace($number_regex, $value, $format);
|
||||
} else {
|
||||
if (preg_match('/0E[+-]0/i', $format)) {
|
||||
if (preg_match('/[0#]E[+-]0/i', $format)) {
|
||||
// Scientific format
|
||||
$value = sprintf('%5.2E', $value);
|
||||
} elseif (preg_match('/0([^\d\.]+)0/', $format)) {
|
||||
|
Loading…
Reference in New Issue
Block a user