Crow
Crow copied to clipboard
Bug in serialization of small double
Steps to reproduce:
#include "crow/json.h"
#include <gtest/gtest.h>
TEST(CrowJson, SmallNumber)
{
crow::json::wvalue data;
const double smallnumber = 1e-10;
data["testValue"] = smallnumber;
std::string text = data.dump( 4);
std::cout << text << std::endl;
};
The serialized text variable contains text similar to 1.000000xxxxxe-01 instead of e-10 at the end.