Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

165
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda