Crow icon indicating copy to clipboard operation
Crow copied to clipboard

Bug in serialization of small double

Open FrK5E opened this issue 5 months ago • 0 comments

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.

FrK5E avatar May 26 '25 12:05 FrK5E