Re: [HACKERS] money data type and conversions

From: "D'Arcy" "J(dot)M(dot)" Cain <darcy(at)druid(dot)net>
To: maillist(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian)
Cc: pgsql-hackers(at)PostgreSQL(dot)org
Subject: Re: [HACKERS] money data type and conversions
Date: 1999-06-23 19:24:18
Message-ID: m10wsd8-0000bFC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thus spake Bruce Momjian
> > Well, can't explain the why's...
> >
> > But I have the code to add to cash.c and cash.h to add the conversion
> > functions, but still have to figure out how to get PostgreSQL to recognize
> > it... Guessing... it's in fmgrtab.c right?
> >
>
> Duane, sonds like people want to remove the Money/cash type and transfer
> everyone over to decimal which has full precision and is much better for
> currency.

Is there any reason why we don't just leave money in? I know that NUMERIC
and DECIMAL will handle money amounts but the money type does a few
extra things related to locale, even if we remove the currency symbol
and perhaps we should leave that in if people are expected to use the
new types. It also determines whether the comma or period is the correct
separator, puts separators in the correct place and determines where the
decimal point goes. Also, check out what the following does.

select cash_words_out('157.23');

Althugh there appears to be a bug in that function that chops the last
character from the output.

--
D'Arcy J.M. Cain <darcy(at){druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 424 2871 (DoD#0082) (eNTP) | what's for dinner.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-06-23 19:53:10 Re: [HACKERS] money data type and conversions]
Previous Message Bruce Momjian 1999-06-23 18:29:49 Re: [HACKERS] The dangers of "-F"