Closed manol-o closed 5 months ago
in choc_JSON.h:182
if (std::isfinite (value)) return choc::text::floatToString (value, -1, true);
to
if (std::isfinite (value)) return choc::text::floatToString (value, -1, false);
fixes the issue. (changed bool value is omitPointIfPossible
)
I guess we haven't noticed a problem because if I want a double, I'd normally call val["foo"].get<double>()
which will do the cast for you even if it's stored as an integer. You'd only hit a snag if you call val["foo"].getFloat64()
, which is strict about checking the type.
But.. I don't think there's anything wrong with the change you're suggesting, it does seem pretty reasonable to always write a json double with the point, and I can't think of any downside to that
Hi, first of all thanks a lot for the nice work of this library!
I encountered an issue, code should make it clear:
Again thanks a lot for the great work