[Django]-Django tastypie serializes DecimalField as json strings instead of numbers

4👍

In JavaScript, JSON decodes to double-precision floating point format, which causes a loss of precision. Decimal objects are encoded to string to maintain precision.

If you want to encode to JSON number format, you can use a FloatField.

👤Druska

Leave a comment