json
json copied to clipboard
Explore string <--> number conversion
value_to
(and number_cast
) could convert string to integer. And we could have a free function that changes a value
to a string if the number is outside +/- 2^53. This should be explored first.
string::to_number
could become a thing, given Charconv dependency.
json::string js = "123";
auto n = js.to_number<int>();
Another question if we then want to add this converstion to value::to_number
.
I think the idea here is that it would be easier for people who want numbers represented as strings in their JSON. I would just close this and let users ask for it.
I vaguely remember that someone actually asked for this, but I can't find an issue, so it probably was a conversation on Slack. @madmongo1, was that you?