Re: Python interface and Money?

From: darcy(at)druid(dot)net (D'Arcy J(dot)M(dot) Cain)
To: hannu(at)tm(dot)ee (Hannu Krosing)
Cc: jmcgraw(at)databill(dot)com (Joel Mc Graw), pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Python interface and Money?
Date: 2001-10-25 11:56:50
Message-ID: 20011025115650.0CB701A6B@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Thus spake Hannu Krosing
> > I have been thinking of creating a money type in Python so that this
> > won't happen but haven't got around to it yet. In the meantime you
> > can always format it with "%.2f" to get the correct value displayed.
>
> There are pure python BigDecimal and Money types available in the same
> place as m2crypto:
>
> http://www.post1.com/home/ngps/m2/

Cool. Two problems, however. I don't know if I can access this from my
C code. This could simply be a learning issue. The other problem is in
making sure that it is always available. It might make more sense to just
create an internal type in pgmodule.c.

> > They keep saying that DECIMAL should be used instead but they are not
> > exactly equivalent. The MONEY type was originally written with locale
> > support and displays the local currency symbol.
>
> This of course will be a real PITA to parse reliably in the adapter ;(

Very true.

--
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 425 1212 (DoD#0082) (eNTP) | what's for dinner.

Browse pgsql-interfaces by date

  From Date Subject
Next Message Peter Eisentraut 2001-10-25 18:32:30 Re: Python interface and Money?
Previous Message D'Arcy J.M. Cain 2001-10-25 11:49:30 Re: Python interface and Money?