Re: Money data type in PostgreSQL?

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Graham Leggett <minfrin(at)sharp(dot)fm>
Cc: Jan Wieck <JanWieck(at)Yahoo(dot)com>, Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Money data type in PostgreSQL?
Date: 2003-12-05 12:49:03
Message-ID: 20031205124903.GB30312@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

It's probably in the documentation, but numeric is stored as a string of
digits (or was it mibbles). In any case, if you wanted to list the weight of
the earth to 20 decimal places, numeric is for you. If you like you can
consider it integer arithmatic except the scaling is handled for you.

The format is NUMERIC(x,y) where x is the total number of digits and y is
the number of decimal places. There are rules about the results of
multiplication and division and such.

Hope this helps,

On Fri, Dec 05, 2003 at 02:39:42PM +0200, Graham Leggett wrote:
> Jan Wieck wrote:
>
> >You won't get any rounding errors in NUMERIC either. What people should
> >be concerned of is to find an arbitrary precision package for the
> >frontend programming language they're using.
>
> What is the definition of a numeric number? I understand (from studying
> numeric methods all those years ago) that the base 10 decimal number 0.1
> cannot be stored exactly in base 2 floating point, thus my use of
> integers - is numeric an arbitrary precision concept?
>
> Regards,
> Graham
> --
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> "All that is needed for the forces of evil to triumph is for enough good
> men to do nothing." - Edmond Burke
> "The penalty good people pay for not being interested in politics is to be
> governed by people worse than themselves." - Plato

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2003-12-05 13:05:18 Re: function to find last day of month
Previous Message Kaarel 2003-12-05 12:44:21 Re: Humor me: Postgresql vs. MySql (esp. licensing)