Bunny83 / SimpleJSON

A simple JSON parser in C#
MIT License
735 stars 294 forks source link

Add ulong support. #32

Closed danvietduong closed 3 years ago

danvietduong commented 4 years ago

This test fails without the change.

public void TestSimpleJSON() { var obj = new SimpleJSON.JSONObject(); obj["ts"] = (ulong)1584652993123L; Assert.AreEqual("{\"ts\":1584652993123}", obj.ToString()); }

The problem seems like C# is picking the float implicit operator and data is being truncated in this cast.