diff --git a/Classes/PHPExcel/Shared/Date.php b/Classes/PHPExcel/Shared/Date.php index 4bae5f2..0c7bb91 100644 --- a/Classes/PHPExcel/Shared/Date.php +++ b/Classes/PHPExcel/Shared/Date.php @@ -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 diff --git a/Classes/PHPExcel/Style/NumberFormat.php b/Classes/PHPExcel/Style/NumberFormat.php index 80347bf..a0688f4 100644 --- a/Classes/PHPExcel/Style/NumberFormat.php +++ b/Classes/PHPExcel/Style/NumberFormat.php @@ -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)) {