I have a class with a decimal property, and I'm serializing and deserializing using JSON.NET. The problem I am having is that if I say the decimal value is 100000000000023063.0, when I deserialize, it will convert to 100000000000023000. I checked JSON and definitely wrote down as 100000000000023063.0.
I looked it up &
decimal.Parse("100000000000023063.0")
=
100000000000023063.0
but
var d = (decimal)100000000000023063.0
=
100000000000023000
I can work around this problem by saving it as a string and getting a property that makes decimal.Parse (), but does anyone know why this is happening?
source
share