adaltas / node-csv

Full featured CSV parser with simple api and tested against large datasets.

Home Page:https://csv.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto parses a string as a number

kennethklee opened this issue · comments

Describe the bug

csv-parse auto parses string that contains only numbers as a float when it shouldn't. I'm transforming a CSV and spitting out CSV.

To Reproduce

Input CSV file:

"Code","Name","Age"
"1234567890AB","Works",123
"123456789012","Doesn't",123

Output CSV file:

Code,Name,Age
1234567890AB,Works,123
1.23456E+11,Doesn't,123

Notice the output CSV transforms "123456789012" into 1.23456E+11

Additional context

Add any other context about the problem here.

I tried to reproduce but the behavior is as expected: https://github.com/adaltas/node-csv/blob/master/demo/issues-esm/lib/381.js

you're right, sorry for wasting your time.

realized it was our transform stream -- didn't think we touched the code column, but I missed it