Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

166
Views
Javascript XLSX module formating data

I would like to change the default value used by XLSX.

Let me explain, here is my code :

var XLSX = require("xlsx");

var workbook = XLSX.read(data, { type: "array" });
console.log(workbook.Sheets["Current positions"]);

Here is an extract from this log :

  C19: {
    t: 's',
    v: 'BE0974320526',
    r: '<t>BE0974320526</t>',
    h: 'BE0974320526',
    w: 'BE0974320526'
  },
  D19: { t: 'n', v: 0.0069, w: '0.69%' },
  E19: { t: 'n', v: 44511, w: '11/11/2021' },

Then I use :

var excelRows = XLSX.utils.sheet_to_row_object_array("Current positions");
console.log(excelRows)

And here is an extract from the log (in the same place as above)

'ISSUER SHARE ISIN code': 'BE0974320526',
'% OF ISSUED CAPITAL': 0.0069,
'POSITION DATE': 44511

The function clearly take the v key as parameter. So my issue is that I want to have the w key field and not the v key field taking into account during XLSX.utils.sheet_to_row_object_array.

For the exemple here :

  • not 0.0069 but '0.69%'
  • not 44511 but '11/11/2021'

I hope to be clear, Thanks for your help !

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Solution is just to add the raw:false parameter like that:

var excelRows = XLSX.utils.sheet_to_row_object_array("Current positions",{raw:false});
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!