Skip to content

Commit d58858f

Browse files
Merge pull request #27 from Deathsteps/number-zero-row-value
Get empty cells when row values are zeroes, expect number zero cells
2 parents b0df315 + 2fa4440 commit d58858f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/components/ExcelFile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class ExcelFile extends React.Component {
4141

4242
React.Children.forEach(columns, column => {
4343
const getValue = typeof (column.props.value) === 'function' ? column.props.value : row => row[column.props.value];
44-
sheetRow.push(getValue(row) || '');
44+
const itemValue = getValue(row);
45+
sheetRow.push(isNaN(itemValue) ? (itemValue || '') : itemValue);
4546
});
4647

4748
sheetData.push(sheetRow);

0 commit comments

Comments
 (0)