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

How to work with long number with csv file? #1215

Closed
amnoman opened this issue Sep 22, 2017 · 6 comments
Closed

How to work with long number with csv file? #1215

amnoman opened this issue Sep 22, 2017 · 6 comments
Assignees

Comments

@amnoman
Copy link

amnoman commented Sep 22, 2017

  1. Newman Version (can be found via newman -v): 3.8.0
  2. OS details (type, version, and architecture): Microsoft Windows [Version 10.0.15063], AMD64
  3. Are you using Newman as a library, or via the CLI? CLI
  4. Did you encounter this recently, or has this bug always been there: Always been there
  5. Expected behaviour: Suppose to parse the Long number without changing last 3-4 digit with 0.
  6. Command / script used to run Newman: newman run "xxxx.postman_collection.json" -n 2 --f testFolder -e xxxx.postman_environment.json -d "TestData.csv" --ssl-client-cert xxxx.crt --ssl-client-key xxxx.key --ssl-client-passphrase xxxx
  7. Sample collection, and auxilliary files (minus the sensitive details):

TestData.csv
Iteration, expectedXXX
1,"89111702272002019559"
2, 89111702272002019542


when script executed "89111702272002019559" changes to 89111702272002020000 and 89111702272002019542 changes to 89111702272002020000

The same csv file works fine in Postman runner when use with double quotes for Iteration 1 but Iteration 2 that is 89111702272002019542 changes to 89111702272002020000

  1. Screenshots (if applicable):
@kunagpal kunagpal added the bug label Sep 26, 2017
@kunagpal kunagpal self-assigned this Sep 26, 2017
@kunagpal
Copy link
Member

@amnoman Thanks for reporting this, I was able to reproduce the bug with the details you provided. I'll update this thread when a fix is being worked on.

@kunagpal
Copy link
Member

I've opened a dedicated issue here: adaltas/node-csv-parse#152

@saswatds
Copy link
Contributor

Hi @amnoman, we are now actively trying to resolve this issue, as a temporary fix you can quote numbers within a single quote '89111702272002019559' instead of double quote, in newman to preserve the number as a string and not loose precision.

The issue is the underlying csv-parse library which newman uses to parse csv files, for which we have raised an issue at adaltas/node-csv-parse#182

@codenirvana
Copy link
Member

@amnoman a fix has been added in #1609 which will be rolled out with the v4 release.

You can test this using v4.0.0-beta.2.

@codenirvana
Copy link
Member

@amnoman This has been fixed in Newman v4.0.0.

@manojattal
Copy link

I am facing this issue. I am on Postman 7.9.0. I am trying to read 19 digit number from csv file. But it rounding the number.

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

No branches or pull requests

5 participants