Closed
Description
I have a json-based config where I write some parameters, and when my application closes it uses the Json::StyledWriter
to save the latest state of my root Json::Value
object. I understand that round trip floating point precision isn't guaranteed to be exact, but is there a way to avoid numbers such as 0.15
being saved as 0.14999999999999999
? This makes the config file difficult to read.
One solution I was wondering about is whether I could limit the precision of floating point numbers, I rarely in this case want more than 4 significant decimals and that would at least improve the use case.