Re: Money data type in PostgreSQL?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Money data type in PostgreSQL?
Дата
Msg-id 20031205124903.GB30312@svana.org
обсуждение исходный текст
Ответ на Re: Money data type in PostgreSQL?  (Graham Leggett <minfrin@sharp.fm>)
Список 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@svana.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

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Kaarel
Дата:
Сообщение: Re: Humor me: Postgresql vs. MySql (esp. licensing)
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: function to find last day of month