Re: [HACKERS] Datatype MONEY

From: wieck(at)debis(dot)com (Jan Wieck)
To: meskes(at)postgreSQL(dot)org (Michael Meskes)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Datatype MONEY
Date: 1999-12-13 15:13:29
Message-ID: m11xXAH-0003kGC@orion.SAPserv.Hamburg.dsh.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)debis(dot)com (Jan Wieck) #

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 1999-12-13 15:44:09 Re: [HACKERS] update_pg_pwd
Previous Message Jan Wieck 1999-12-13 14:52:25 Re: [HACKERS] Datatype MONEY