dominictarr / excel-stream

MIT License
137 stars 38 forks source link

Empty value in excel is converted into 0 #15

Open sc-brikis opened 8 years ago

sc-brikis commented 8 years ago

Every empty value in excel is converted to 0 due to fact that:

isNaN('') => false

and line 41: _data[k.trim()] = isNaN(value) ? value : +value

makes empty record to 0.

I suggest following to check if value is number or not:

(isNaN(value) || value === '') ? value : +value;

you can find working sample here.

raapperez commented 8 years ago

Is there a solution for this?