Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Values of 0 not encoded. #22

Closed
rhema opened this issue Sep 2, 2014 · 0 comments
Closed

Values of 0 not encoded. #22

rhema opened this issue Sep 2, 2014 · 0 comments
Labels

Comments

@rhema
Copy link

rhema commented Sep 2, 2014

To reproduce, run the following code example from README.md

var data = [[1850, 20, 0, 1, 1017281], [1850, 20, 0, 2, 1003841]];
new CSV(data).encode();

generates the string:

"1850,20,,1,1017281
1850,20,,2,1003841"

Rather than the expected:

"1850,20,0,1,1017281
1850,20,0,2,1003841"

For my own, limited context, I added:

if (value == 0) return "0";

to the top of the stringify function. That fixed it for me. I'm not particularly familiar with this code base, so I doubt that's the right thing to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants