Skip site navigation (1) Skip section navigation (2)

Re: jdbc rounding value for numeric fields

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Ioana Danes <ioanasoftware(at)yahoo(dot)ca>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: jdbc rounding value for numeric fields
Date: 2009-05-25 15:15:49
Message-ID: 3503.1243264549@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-jdbc
Ioana Danes <ioanasoftware(at)yahoo(dot)ca> writes:
>            ps.setDouble(1,2.6999999999999997);

Don't use setDouble.  float8 to numeric conversion only preserves
DBL_DIG (ie, 15 on standard platforms) decimal digits, since that's
the most that can be fully trusted in a float8 value.

			regards, tom lane

In response to

pgsql-jdbc by date

Next:From: Ioana DanesDate: 2009-05-25 15:16:46
Subject: jdbc rounding value for numeric fields
Previous:From: Ioana DanesDate: 2009-05-25 14:59:53
Subject: jdbc rounding value for numeric fields

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group