Re: [cx-oracle-users] Cx_Oracle - Rounding Problem
Brought to you by:
atuining
From: Anurag C. <anu...@gm...> - 2011-01-18 20:15:02
|
This is easily done in Python. Please use the fetched value in the manner that I have indicate below and see if it helps your cause. >>> A=cursor.fetchall() >>> B=A[0][0] >>> print B 346000000.0 >>> B.real 345999999.9999 Regards, Anurag On Wed, Jan 19, 2011 at 1:22 AM, Roberto Badillo Ibarra < bet...@ho...> wrote: > Hi, > > Well , when i have a float number with different numbers from 9 is ok, but > when i have a number like 99345999999.9999 let me show you my problem > > For example, I have a value of 99345999999.9999 in the DB > > >>> query="select number from Data" > >>> cursor.execute(str(query)) > >>> A=cursor.fetchall() > >>> B=A[0][0] > >>> print B > 99346000000.0 > > I dont know why the object on Python script is rounding my float numbers. > > I dont want to print or save in a variable this value=99346000000.0 , I > want 99345999999.9999 > > Please Help Me > > > ------------------------------ > From: anu...@gm... > Date: Wed, 19 Jan 2011 00:06:16 +0530 > Subject: Re: [cx-oracle-users] Cx_Oracle - Rounding Problem > To: cx-...@li...; bet...@ho...; > ama...@gm...; jb...@gm...; ant...@gm... > > > cx_Oracle fetches the value as it is in the DB for me. > > For example, I have a value of 26.3672 in the DB and it appears as it > is.......Below is my code snippet. > > >>> query="select unit_vol from item" > >>> cursor.execute(str(query)) > >>> A=cursor.fetchall() > >>> B=A[0][0] > >>> print B > 26.3672 > > It could be that you are doing some Type Conversion Un-Intentionally in > your Python Code. > > Please post your code snippet along with the value that you have in DB so > that we can help you further. > > Regards, > Anurag > > On Tue, Jan 18, 2011 at 11:53 PM, Roberto Badillo Ibarra < > bet...@ho...> wrote: > > > Hello, > > My name is Roberto, Im new with all the stuff of Cx_Oracle. > > I'm working with Python 2.7 > S.O. Windows Server 2003 > > Well, my problem is that when I'm doing a query to the database i have a > column with a big float number but when I print my object I see that my > numbers are rounded , what can I do ? I need the number with no rounding , > please help me > > I'm new with this stuff. > > > ------------------------------------------------------------------------------ > Protect Your Site and Customers from Malware Attacks > Learn about various malware tactics and how to avoid them. Understand > malware threats, the impact they can have on your business, and how you > can protect your company and customers by using code signing. > http://p.sf.net/sfu/oracle-sfdevnl > _______________________________________________ > cx-oracle-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-oracle-users > > > |