This project has moved and is read-only. For the latest updates, please go here.

problem: deserialize to decimal is not exactly

Aug 21, 2010 at 4:13 AM

I have problem when deserialize to decimal:

  Decimal number = JsonConvert.DeserializeObject<Decimal>("123456789876543.21");

limit to 15 digits:

  // number = 123456789876543

but, it must:

// number = 123456789876543.21

I known the reason, the JsonConvert use double to store the number (I can edit source code and use decimal).

In my business, I have a big money(over 15 digits) and it can’t store exactly

Why we don’t use decimal when deserialize?


Aug 23, 2010 at 1:46 PM



the way i solved this is to send it as a string to the client and then parsefloat on client side...

Sep 12, 2010 at 12:21 PM

I've fixed this bug in the latest version of the source code