You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dumping a small number_float just outputs 0.000000 #37
I expected that small doubles would be represented in dumped JSON as a javascript number in scientific notation, but instead it just appears as 0.000000
Looking at the json code, it appears this is due to using std::to_string() for all numbers, which is equivalent to sprintf("%f", ...) whereas sprintf("%g", ...) would be more appropriate. To fix this, the dump function would need to use something other than to_string to format floating point numbers. I'll try to put together a PR for this although C++ is far from my best language.
Activity
jrandall commentedon Mar 23, 2015
Any issues with this that I could address to get it merged?
nlohmann commentedon Mar 23, 2015
I was on holiday... I'll check this issue tonight.
Merge pull request nlohmann#37 from nlohmann/develop