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

Re: JDBC and numeric datatype...

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: Scott Muir <wsmuir(at)islandnet(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: JDBC and numeric datatype...
Date: 2001-05-16 19:50:00
Message-ID: 200105161950.PAA05354@jupiter.jw.home (view raw or flat)
Thread:
Lists: pgsql-interfaces
Scott Muir wrote:
> Can someone suggest the correct way of dealing with the NUMERIC data type
> through JDBC?  The attribute in question is a NUMERIC(10,2) (currency)...
> We're thinking of just using a float to handle it...  Since this type can be
> much larger than we're using, what should be used in those cases???

    Look  for  some arbitrary precision math library to deal with
    it. NUMERIC in PostgreSQL is an exact numeric  data  type,  a
    strict  requirement  when  dealing  with  monetary  values in
    bookkeeping systems. A single conversion  to  and  back  from
    floating point violates this requirement already.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#================================================== JanWieck(at)Yahoo(dot)com #



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


In response to

pgsql-interfaces by date

Next:From: Carlos MorenoDate: 2001-05-17 01:04:26
Subject: libpq++ and strings.
Previous:From: L. UserDate: 2001-05-15 22:52:47
Subject: libpq under Win CE

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