Wrong number parsing
See original GitHub issueI got wrong number parsing result when import from excel. My result
SSF format
My handle code
`handleFile(e) { var files = e.target.files, f = files[0]; var reader = new FileReader(); var rABS = true var _this = this; reader.onload = function(e) { var data = e.target.result; if(!rABS) data = new Uint8Array(data); var workbook = XLSX.read(data, {type: rABS ? ‘binary’ : ‘array’});
/* DO SOMETHING WITH workbook HERE */
_this.to_json_first_sheet(workbook)
console.log(workbook)
};
if(rABS) reader.readAsBinaryString(f); else reader.readAsArrayBuffer(f);
}
to_json_first_sheet: function(workbook){ var result = {}; var _this = this; var sheetName = workbook.SheetNames[0]; var roa = _this.X.utils.sheet_to_json(workbook.Sheets[sheetName],{}); console.log(roa) if(roa.length) result = roa; return result; } `
My excel file ( github doesn’t accept xls file so I updated it into google driver) https://drive.google.com/file/d/1l1TLlycLpYjrhWzpO5fUipp-UCO49rzU/view
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@ToujouAya we are releasing 0.11.11 right now with the fix. Give it some time to show up on NPM and CDNs. Your code should work as-is.
@SheetJSDev Oh thank you so much. I appreciate