8000 Empty value in excel is converted into 0 · Issue #15 · dominictarr/excel-stream · GitHub
[go: up one dir, main page]

Skip to content

Empty value in excel is converted into 0 #15

Open

Description

@sc-brikis

Every empty value in excel is converted to 0 due to fact that:

isNaN('') => false

and line 41: _data[k.trim()] = isNaN(value) ? value : +value

makes empty record to 0.

I suggest following to check if value is number or not:

(isNaN(value) || value === '') ? value : +value;

you can find working sample here.

Activity

  1. raapperez commented on Oct 31, 2016

    @raapperez

    Is there a solution for this?

  2. added a commit that references this issue on Mar 29, 2017
  3. added a commit that references this issue on Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0