On Fri, Apr 05, 2024 at 03:16:44PM +0200, Herman, Géza wrote: [...] > I don't think it's relevant here. If I reformat a JSON, it should really be > a formatting operation, it shouldn't matter what kind of floating point > numbers a platform supports. We are not talking about reading a JSON, but > formatting it [...] It seems you have no choice but to keep the string representation around, then. There are other possible anomalies with numbers, like "leading zeros", where a conversion to number and back would transform 0042 -> 42. Likewise with 1e2 -> 100 and so on. When transformed into numbers, you lose that information. Note that 0.2 is an infinite binary fraction, i.e. if you go binary and back under most JSON implementations, you'd always get a result depending on the underlying precision, rounding strategies, etc. Cheers -- t