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

Round-off error when using col_type = "text" #743

Open
CarolusKwok opened this issue Mar 17, 2024 · 0 comments
Open

Round-off error when using col_type = "text" #743

CarolusKwok opened this issue Mar 17, 2024 · 0 comments

Comments

@CarolusKwok
Copy link

I'm trying to open a xlsx file (call it "a.xlsx" where I'm trying to open the "data" sheet) with the following code, within the excel sheet is a list of numbers in the "general" format, that I want to be read in the text format.

readxl::read_excel(path = "a.xlsx", sheet = "data", col_types = "text")

Instead of a column called "numbers" followed by 1.1, 1.2, 1.3 ... the resulting tibble pops up 1.1000000000000001, 1.2000000000000002 1.3000000000000003, 1.4000000000000004, 1.5000000000000004, 1.6000000000000005, 1.7000000000000006, 1.8000000000000007 1.9000000000000008, 2.0000000000000009

It seems like a round-off error has occured?! May someone fixed this?

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

No branches or pull requests

1 participant