On Tue, Jan 14, 2014 at 7:23 AM, Eric Rouleau <[email protected]> wrote:
> The problem seems to be in the postgres backend or Psycopg 2.5.2 adapter...
> I have the same problem and the data in postgres is 0.00000000 but when
> fetched by django it comes up as Decimal("0E-8") (with shell access not only
> admin), if I switch to sqlite3 backend then it works perfectly
>

Decimal("0E-8") == Decimal(0) == Decimal(0.0)

If you do not want the python representation of your field to be a
Decimal, do not use DecimalField, use FloatField.

https://docs.djangoproject.com/en/1.5/ref/models/fields/#floatfield-vs-decimalfield

http://docs.python.org/2.7/library/decimal.html#module-decimal

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAFHbX1Lw01ObSEdN-9Kvm-yhV-pDOanTNQOE57YD5bGRv2dn2g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to