Skip to content

Improve number-to-string conversion #1334

Description

@nlohmann

The dump_integer function is naive custom code and the dump_float function uses a Grisu2 implementation. This leaves a lot of room for improvements.

In C++17, we could use <charconv>'s std::to_chars as pointed out by u/STL and live happily ever after. Unfortunately, we are still sticking around with C++11.

Examples for code to try are:

Maybe there are other projects, too.

It would be great to try different implementations. The largest piece of work should usually be to make it run as single header, and to adjust it to the interface.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: enhancement/improvementstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions