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

write_csv2/format_csv2 adds leading whitespace to numbers #1046

Closed
keesdeschepper opened this issue Nov 15, 2019 · 3 comments · Fixed by #1048
Closed

write_csv2/format_csv2 adds leading whitespace to numbers #1046

keesdeschepper opened this issue Nov 15, 2019 · 3 comments · Fixed by #1048

Comments

@keesdeschepper
Copy link
Contributor

When using write_csv2 or format_csv2, leading whitespace is added to values in a number column if the numbers are of different length:

readr::format_csv(tibble(x = c(6, 66)))
# "x\n6\n66\n"
readr::format_csv2(tibble(x = c(6, 66)))
# "x\n 6\n66\n"

This is against the csv format (whitespace is significant). Perhaps add trim = TRUE to format in change_decimal_separator?

@jimhester
Copy link
Collaborator

jimhester commented Nov 15, 2019

You are correct, want to submit a PR to fix the issue?

@keesdeschepper
Copy link
Contributor Author

Sure

@lock
Copy link

lock bot commented May 20, 2020

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants