Re: [HACKERS] Datatype MONEY

Поиск
Список
Период
Сортировка
От wieck@debis.com (Jan Wieck)
Тема Re: [HACKERS] Datatype MONEY
Дата
Msg-id m11xXAH-0003kGC@orion.SAPserv.Hamburg.dsh.de
обсуждение исходный текст
Ответ на Re: [HACKERS] Datatype MONEY  (Michael Meskes <meskes@postgreSQL.org>)
Список pgsql-hackers
Michael Meskes wrote:

> On Mon, Dec 13, 1999 at 01:13:55PM +0100, Karel Zak - Zakkr wrote:
> >  I have complete code for numbers formatting (to_char() compatible with
> > Oracle). It allow you add a currency symbol corresponding with current
>
> Sounds good.
>
> > locale ... and more features over basic datatypes (float4/8, int4/8).
>
> Not about DECIMAL/NUMERIC? I don't like the idea of doing currecny
> calculations with floats.

    First it's a variable size datatype. There's some information
    about weight of  first  digit,  precision,  scale  and  sign.
    Following  are  all  digits  coded  into  nibbles  (4-bit per
    digit).

    The weight tells which of the digits WRT to the decimal point
    the  first nibble contains. Precision and scale tell how many
    digits at all and after DP to have. Leading and trailing zero
    digits  are  stripped  off  in  the  DB  stored value with an
    adjusted weight, so a 5000000000000 value with a precision of
    200  digits will only occupy one nibble when stored. A single
    5 with a weight of 12.

    If I  ever  find  the  time  (soonest  2001  I  expect)  I'll
    completely  replace  the  digit storage by small integers and
    store the value  in  base  10000  instead  of  10.  Just  for
    performance reasons.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #

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

Предыдущее
От: wieck@debis.com (Jan Wieck)
Дата:
Сообщение: Re: [HACKERS] Datatype MONEY
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] update_pg_pwd