I am reading an excel file using SheetJs, but the issue is it's converting long numbers like 3577888990098 to exponential like 3.52E+12.
This question is not duplicate, because:
File columns can be random and system won't know which ones are numbers and which ones are Strings (Alphabetical) or both.
So how to get rid of this?
Here is my code:
function handleFileSelect(evt) {
var files = evt.target.files;
var i, f;
//Loop through files
for (i = 0, f = files[i]; i != files.length; ++i) {
var name = f.name;
const reader = new FileReader();
reader.onload = (evt) => {
/* Parse data */
const bstr = evt.target.result;
const wb = XLSX.read(bstr, {type:'binary'});
/* Get first worksheet */
const wsname = wb.SheetNames[0];
const ws = wb.Sheets[wsname];
/* Convert array of arrays */
const data = XLSX.utils.sheet_to_csv(ws, {header:1});
/* Update state */
console.log("DATA>>>"+data);
};
reader.readAsBinaryString(f);
}
}