Re: jdbc rounding value for numeric fields - Mailing list pgsql-jdbc

From Tom Lane
Subject Re: jdbc rounding value for numeric fields
Date
Msg-id 3503.1243264549@sss.pgh.pa.us
Whole thread Raw
In response to jdbc rounding value for numeric fields  (Ioana Danes <ioanasoftware@yahoo.ca>)
List pgsql-jdbc
Ioana Danes <ioanasoftware@yahoo.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

pgsql-jdbc by date:

Previous
From: Ioana Danes
Date:
Subject: jdbc rounding value for numeric fields
Next
From: Ioana Danes
Date:
Subject: jdbc rounding value for numeric fields