c2c-oerpscenario team mailing list archive
-
c2c-oerpscenario team
-
Mailing list archive
-
Message #00520
[Bug 663045] Re: using the decimal module instead of __builtins__.float
Hello ViktorNagy,
Indeed this has been suggested several times, unfortunately it implies a
lot more changes than what you might think initially (as Decimal and
floats don't have the same API), and would require rewriting a lot of
code. Decimal also suffers from its own drawbacks, such as performance
issues, etc.
See for example these messages from OpenERP CEO for more info:
- https://lists.launchpad.net/openerp-expert-accounting/msg00067.html
- https://lists.launchpad.net/openerp-expert-accounting/msg00082.html
** Changed in: openobject-server
Importance: Undecided => Wishlist
** Changed in: openobject-server
Status: New => Opinion
--
using the decimal module instead of __builtins__.float
https://bugs.launchpad.net/bugs/663045
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to OpenERP OpenObject.
Status in OpenObject Server: Opinion
Bug description:
I just had a look at the decimal module introduced in python 2.4 [1], and after another glance at the float field.
Is there a reason why we don't use the rounding-agnostic decimal module instead of the float type?
As far as I can see, only a few lines should be changed, something like this in fields.py:float
_symbol_f = lambda x: decimal.Decimal(str(x) or '0.0')
[1]: http://docs.python.org/library/decimal.html
References