From 6eef69634bc0dcd988359b67ee685b2022f1626c Mon Sep 17 00:00:00 2001 From: Chris Graham Date: Sun, 22 Mar 2015 22:58:20 +0000 Subject: [PATCH] Normalised numeric handling between XLS and XLSX, plus PSR2 --- src/Spout/Writer/Internal/XLSX/Worksheet.php | 2 +- src/Spout/Writer/XLS.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Spout/Writer/Internal/XLSX/Worksheet.php b/src/Spout/Writer/Internal/XLSX/Worksheet.php index 5f919f6..8007d3d 100644 --- a/src/Spout/Writer/Internal/XLSX/Worksheet.php +++ b/src/Spout/Writer/Internal/XLSX/Worksheet.php @@ -139,7 +139,7 @@ EOD; if (empty($cellValue)) { $data .= '/>' . PHP_EOL; } else { - if (trim($cellValue,'0123456789.') == '' /*similar to is_numeric without having PHPs regular quirkiness*/) { + if (trim($cellValue, '0123456789.') == '' /*similar to is_numeric without having PHPs regular quirkiness*/) { $data .= '>' . $cellValue . '' . PHP_EOL; } else { if ($this->shouldUseInlineStrings) { diff --git a/src/Spout/Writer/XLS.php b/src/Spout/Writer/XLS.php index dc3a295..e84b0db 100644 --- a/src/Spout/Writer/XLS.php +++ b/src/Spout/Writer/XLS.php @@ -143,7 +143,7 @@ class XLS extends AbstractWriter $this->home(); foreach ($dataRow as $cell) { - if (is_integer($cell)) { + if (trim($cell, '0123456789.') == '' /*similar to is_numeric without having PHPs regular quirkiness*/) { $wasWriteSuccessful = $wasWriteSuccessful && $this->number($cell); } else {