Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

168
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda