Skip to content

write_csv2/format_csv2 adds leading whitespace to numbers #1046

Closed

Description

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?

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions