openerp-expert-framework team mailing list archive
-
openerp-expert-framework team
-
Mailing list archive
-
Message #00417
Re: float errors propagating to 10^-2 in OpenERP v5...
Nicolas Bessi wrote:
Hello,
Instead of using decimal why not using long to store and compute then
do the conversion at the end of computation.
We should not have rounding error and it should be faster than
Decimal. (But we will be limited in the numeric range of long)
That works well if you know that you have a fixed precision. For example
if you know that you will have always numbers with two digits after the
decimal point you can multiply them by 100 and store that as an integer,
but...
1. sys.maxint on 32bit systems is 2147483647, if you have two digits,
that would give you a maximum of 21474836.47, that is 21 millions,
a bit quantity for most mortals but not enough for medium/big
companies :(
2. OpenObject is supposed to be a flexible framework, so we need a
flexible way of working with decimal numbers with variable
precision, on some countries two digits after the decimal point
may be enough (Spain, France), but we can't guarantee that's true
for other countries.
3. Using floats on the SQL level makes it easier to work with the
data from external programs (i.e. data warehouse).
--
Borja López Soilán
borjals@xxxxxxxxx
Pexego Sistemas Informáticos S.L.
Avenida de Magoi 66 - 27002 Lugo (España)
Tel./Fax 982801517
http://www.pexego.es
AVISO LEGAL - CLÁUSULA DE PRIVACIDAD
Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o confidencial. Si no es usted el destinatario indicado, queda informado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.
Follow ups
References