From: | wieck(at)debis(dot)com (Jan Wieck) |
---|---|
To: | zakkr(at)zf(dot)jcu(dot)cz (Karel Zak - Zakkr) |
Cc: | meskes(at)postgreSQL(dot)org, pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Re: [HACKERS] Datatype MONEY |
Date: | 1999-12-13 12:34:54 |
Message-ID: | m11xUgo-0003kGC@orion.SAPserv.Hamburg.dsh.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Karel Zak - Zakkr wrote:
> On Mon, 13 Dec 1999, Michael Meskes wrote:
>
> > I somehow remember the MONEY datatype has some problems and might be
> > removed. Now I didn=B4t follow this topic closely enough, but now I've
> > encountered I could use it pretty well. Of course a DECIMAL datatype fi=
> ts
> > the bill as good since I do not need the currency symbol in psql's outp=
> ut.
> >=20
> > Before I set up my DB I'd like to know which type to prefer.
> >=20
> > Michael
>
> I have complete code for numbers formatting (to_char() compatible with
> Oracle). It allow you add a currency symbol corresponding with current
> locale ... and more features over basic datatypes (float4/8, int4/8).
>
> I send it to the PACHES list next week (probably). =20
>
>
> Example:
>
> template1=3D> select float8_to_char(455.9 , 'L999D99') as price;
> price
> ---------
> Kc 455,90
> (1 row)
>
> (It is with Czech currency symbol and decimal point (locales))
>
> IMHO is good use for money a float type.
In some countries (Germany at least) storage of financial
booking information is not permitted to use floats. And you
aren't allowed to use it for calculation of taxes etc.,
instead you must use some datatype with a fixable number of
digits after the decimal point.
Thus, only our NUMERIC/DECIMAL type or int4/8 and using the
'V' (IIRC) format specifier in to_char() should be used.
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) #
From | Date | Subject | |
---|---|---|---|
Next Message | Mike Mascari | 1999-12-13 13:03:43 | Is something wrong here? |
Previous Message | Karel Zak - Zakkr | 1999-12-13 12:26:47 | Re: [HACKERS] createdb with alternate location |