Re: Python interface and Money?
От | darcy@druid.net (D'Arcy J.M. Cain) |
---|---|
Тема | Re: Python interface and Money? |
Дата | |
Msg-id | 20011025115650.0CB701A6B@druid.net обсуждение исходный текст |
Ответ на | Python interface and Money? (Joel Mc Graw <jmcgraw@databill.com>) |
Список | 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@{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.
В списке pgsql-interfaces по дате отправления: