Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Problems displaying floats as exponential values

2 posts in JDBC Connect (product renamed to JConnect) Last posting was on 1997-05-21 16:59:24.0Z
James T. Boyce Posted on 1997-05-19 16:41:07.0Z
From: "James T. Boyce" <boycej@nuveen.com>
Subject: Problems displaying floats as exponential values
Message-ID: <01bc648c$e92beba0$5cbaadce@crc3.concentric.net>
X-Newsreader: Microsoft Internet News 4.70.1160
Newsgroups: sybase.public.jdbcconnect
Date: Mon, 19 May 1997 12:41:07 -0400
Lines: 16
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:824
Article PK: 252580

Why is it that when I do either a rs.getFloat or rs.getString on a
ResultSet column that has float values in it that what I get back is
formatted as an exponential value instead of the value as it looks in my
table. Case in point: If I query my SQL Server through ISQL the value in a
column looks like this:

999999999.0

but, if I do a getString or getFloat on that same value tthrough my applet,
I get

1e+009

returned. Why is that? How can I change it so it comes back as

999999999.0? Or even better... I would like to have the value formatted
with commas in it so it looks like:

999,999,999.0


David Clegg Posted on 1997-05-21 16:59:24.0Z
Message-ID: <338329EC.55F9FF19@sybase.com>
Date: Wed, 21 May 1997 09:59:24 -0700
From: David Clegg <davec@sybase.com>
X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i586)
MIME-Version: 1.0
To: "James T. Boyce" <boycej@nuveen.com>
Subject: Re: Problems displaying floats as exponential values
References: <01bc648c$e92beba0$5cbaadce@crc3.concentric.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: sybase.public.jdbcconnect
Lines: 21
Path: forums-1-dub!forums-master.sybase.com!forums.powersoft.com
Xref: forums-1-dub sybase.public.jdbcconnect:793
Article PK: 252545

jConnect is not doing any formating here. You'd have to ask
javasoft why their java.lang.Float.toString() method is doing this.

dave

>
> Why is it that when I do either a rs.getFloat or rs.getString on a
> ResultSet column that has float values in it that what I get back is
> formatted as an exponential value instead of the value as it looks in my
> table. Case in point: If I query my SQL Server through ISQL the value in a
> column looks like this:
>
> 999999999.0
>
> but, if I do a getString or getFloat on that same value tthrough my applet,
> I get
>
> 1e+009
>
> returned. Why is that? How can I change it so it comes back as
>
> 999999999.0? Or even better... I would like to have the value formatted
> with commas in it so it looks like:
>
> 999,999,999.0