freelancersunion/django-salesforce — pull request #24 by jacobwegner (2014-02-15 16:46:45+00:00)
Title: Fix precision error when deserializing field to DecimalFields

Serialize from the string representation rather than the float to avoid precision errors.

>>> import decimal
>>> field_val = 26624.34
>>> to_python = decimal.Decimal(field_val)
>>> to_python
Decimal('26624.34000000000014551915228366851806640625')
>>> field_val = str(field_val)
>>> to_python = decimal.Decimal(field_val)
>>> to_python
Decimal('26624.34')