problems with float8
Milton inostroza <[email protected]> Wed, 15 Jun 2005 20:39:23 -0400
| Newsgroups | gmane.comp.python.db.pypgsql.user |
|---|---|
| Message-ID | <[email protected]> |
hello: they know I am rescuing values from the following table:
CREATE TABLE afp
(
nombre_afp varchar(75) NOT NULL,
razon_social_afp varchar(75),
porcentaje_afp float8,
CONSTRAINT pk_afp PRIMARY KEY (nombre_afp)
)
by means of the console psql, I make the following thing:
remunex=3D# select * from afp;
nombre_afp | razon_social_afp | porcentaje_afp
------------+------------------+----------------
G | | 1.9
AFP | AFP S.A. | 1.7
GT | | 2.6
(3 filas)
it is to say float's are ok!=20
now, I make the following thing from python
def lista_datos(self):
self.modelo.clear()
sql=3D"""SELECT nombre_afp,razon_social_afp, porcentaje_afp
FROM afp
ORDER BY nombre_afp
"""
self.cursor.execute(sql)
r=3Dself.cursor.fetchall()
print r
and the result is the following one:
[['AFP', 'AFP S.A.', 1.0], ['G', '', 1.0], ['GT', '', 2.0]]
and... aca is the error, if they pay attention the part decimal of
float is in zero, somebody can help me with this... could be some
configuration of global variables....esto before did not pass (python
to me 2.3.5) and now with python2.4 it is happening to me, salu2!
--=20
Milton Inostroza Aguilera
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click