Skip to content

Can the data_type() function be widely used? #253

@wiluite

Description

@wiluite

Hello,

Suppose one has "1e -3" in his csv field and thinks it is a string. But the csv parser tells: "it is a CSV_DOUBLE with value 0.001".
Is that representation of double is correct enough (from the absolute point of view, allowed in numeric packages)?

Thanks.

    using namespace csv;
    using namespace csv::internals;
    long double ld;
    std::string_view sv {"1e    -3"};
    auto t = data_type(sv, &ld);
    assert(t == DataType::CSV_DOUBLE);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions