JSON3 - How write(serialize) the specified number of significant digits?

Thanks, guys @StefanKarpinski & @Palli for a quick response and recommendations. I found a mistake with constructor obj[:w] ./ sum(obj[:w]) where GMMmodel expects exactly 1.0 and the SHA256 signature did not fit. Sorry :smiley: I also applied round in the constructor of a struct.

However, I have a new problem with valid writing a vector or value using serialization (method JSON3.write). I would expect to write the vector as a valid JSON format (and a simple format for other parsers). For e.g vector Foo([2.3, 4.5, NaN], NaN) as

{ “a”: [2.3, 4.5, null ], “b”: null} #This is expected :slight_smile:

As I mentioned in the link. Some suggestions for (de)serialize?

I tried to choose a number as a string.

JSON3.StructType(::Type{<:Float64}) = JSON3.StringType()

but I’ll just get only this {"a": ["2.3", "4.5", "null" ], "b": "null"} :frowning: duplicate quotes :roll_eyes: