Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Causeless DecimalField behavior #637

Closed
zzzsochi opened this issue May 7, 2014 · 6 comments
Closed

Causeless DecimalField behavior #637

zzzsochi opened this issue May 7, 2014 · 6 comments

Comments

@zzzsochi
Copy link

zzzsochi commented May 7, 2014

DecimalField should not use float to store its values. It is crucial to never use float for Decimal as it is often used for financial tasks.

I suggest to use Int and precision metainfo somewhere nearby.

@rozza
Copy link
Contributor

rozza commented Jun 27, 2014

DecimalField was a contributed field - I'm more than happy to take a PR to improve it

@lafrech
Copy link
Member

lafrech commented Jun 28, 2016

FWIW, a new Decimal type was added in MongoDB 3.3.8 / pyMongo 3.4.

Nov 29, 2016: Newly released Mongo DB 3.4 adds decimal data type. It would make sense to use it when using Mongo DB 3.4.

@julianwachholz
Copy link

@lafrech any plans for implementing this native NumberDecimal type?

@kotofos
Copy link

kotofos commented Aug 31, 2018

I highly suggest to add big warning to docs about Decimal - Float conversion.

@denex
Copy link

denex commented Aug 31, 2018

decimal
As far as now it completely loses precision I would suggest raising NotImplementedException in order to prevent data loss.

@erdenezul
Copy link
Collaborator

Explanation merged into master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants