i am getting rounded values as string from csv, i don't want values to get rounded of i need the exact value from the csv is there any way?
(async() => {
try {
let csvInUsers = []
const jsonArray = await csv({
trim: true
}).fromFile(csvFilePath);
////// Invalid CSV /////
if (typeof jsonArray[0]['_id'] == 'undefined' ||
typeof jsonArray[0]['playerId'] == 'undefined') {
let error = new Error('Uploaded csv is invalid.');
error.statusCode = 400;
error.code = 'INVALID_CSV';
fs.unlinkSync(csvFilePath);
return cb(error);
}
////// Invalid CSV /////
async.eachSeries(jsonArray, function(value, callback) {
(async() => {
try {
UserCollection.updateOne({
_id: ObjectId(value._id)
}, {
$set: {
playerId: String(value.playerId)
}
})
callback(null)
} catch (error) {
if (error) console.log(error);
callback(error)
}
})();
}, (err) => {
if (err) console.log(err);
fs.unlinkSync(csvFilePath);
cb()
});
} catch (error) {
cb(error)
}
})();
7945160000000000 getting rounded to 7.95E+15 i was expecting the exact value in csv getting read