Skip to content

String becomes Infinity after Number() #905

Closed
@sophiedophie

Description

@sophiedophie

Hello, I found an issue here.
https://github.com/exceljs/exceljs/blob/master/lib/csv/csv.js#L71

At this line, if we get the string such as 6E10000, then datumNumber would be Infinity but still return it because !Number.isNaN(datumNumber) is true so we can't open the generated excel file.

const str = '6E10001';
console.log(Number(str)); // Inifinity

So we should add one more condition, so the condition should be

if (!Number.isNaN(datumNumber) && datumNumber !== Infinity) {
  return datumNumber;
}

If people agree with this, I want to make a PR for this. thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy