Swifter.Json icon indicating copy to clipboard operation
Swifter.Json copied to clipboard

deserialization will convert double value to string if value has no fraction

Open workhours opened this issue 2 years ago • 0 comments

        [TestMethod]
        public void JsonTest()
        {
            double expected = 1.0;
            string json= "{\"a\":1.0}";
            var obj = JsonFormatter.DeserializeObject<Dictionary<string, object>>(json);
            Assert.AreEqual(expected, obj["a"]);
        }

workhours avatar Mar 23 '22 09:03 workhours