Code review comment for lp:~openerp-dev/openobject-server/trunk-float-rounding-odo

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I think I'm done with the final changes here:
- tie-breaking epsilon has been implemented similarly to what was discussed on bug bug 882036 in order to perform proper HALF-UP rounding
- an additional float_repr method was added in float_utils to render a float to a str, as the default str() and repr() do not do what we need. repr() will not round appropriately, and str() will round too eagerly when there are more than 12 significant digits, for some reason.
- the ORM has been updated to properly apply rounding before persisting a value (this is really what bug 882036 was about). It passes the float values to postgres using float_repr, to avoid any precision loss.
- YAML tests updated to include thousands of cases from low to high magnitudes + a test of float round-trip via the database too

« Back to merge proposal