Skip to content

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

@CarolusKwok

Description

@CarolusKwok

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions