Fix CellValueFormatter for numeric values
The value passed into the format() function is coming from an XML file and has never been coerced. Therefore, when checking is_int($value), the check always returns false - because it's a string. Changing the check fixes the issue and Spout now correctly parses large numbers.
This commit is contained in:
1 parent
c48c07db99
commit
4a5da2ad74
3 files changed
+67
-20
No files matched your search
@@ -169,7 +169,8 @@ class CellValueFormatter
|
||||
if ($shouldFormatAsDate) {
|
||||
return $this->formatExcelTimestampValue(floatval($nodeValue));
|
||||
} else {
|
||||
return is_int($nodeValue) ? intval($nodeValue) : floatval($nodeValue);
|
||||
$nodeIntValue = intval($nodeValue);
|
||||
return ($nodeIntValue == $nodeValue) ? $nodeIntValue : floatval($nodeValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user