Skip to content

Commit

Permalink
Fix for importing 0 as null, fixes issue #153
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbrouwers committed Jun 22, 2014
1 parent 3fbb365 commit f8de5de
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Maatwebsite/Excel/Collections/CellCollection.php
Expand Up @@ -46,7 +46,7 @@ public function setItems($items)
foreach($items as $name => $value)
{
if($name)
$this->put($name, $value ? $value : null);
$this->put($name, $value || is_numeric($value) ? $value : null);
}
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Readers/ChineseXlsReaderTest.php
Expand Up @@ -73,12 +73,12 @@ public function testToArray()
array(
'商品編號' => 'L01A01SY047',
'商品名稱' => 'LED T8燈管',
'實際數量' => '1',
'實際數量' => 1,
),
array(
'商品編號' => 'L01A01SY046',
'商品名稱' => 'LED T8燈管',
'實際數量' => '1',
'實際數量' => 1,
)

), $array);
Expand Down

0 comments on commit f8de5de

Please sign in to comment.