Re: How to use the postgresql money type?

Поиск
Список
Период
Сортировка
От A.M.
Тема Re: How to use the postgresql money type?
Дата
Msg-id 2AFC89AC-2F73-4D7D-A42A-004E89BB05C3@themactionfaction.com
обсуждение исходный текст
Ответ на Re: How to use the postgresql money type?  (Federico Di Gregorio <federico.digregorio@dndg.it>)
Список psycopg
On Jan 20, 2011, at 10:45 AM, Federico Di Gregorio wrote:

> On 20/01/2011 16:40, A.M. wrote:
>>
>
> But this makes sense. Do you mean that banker's rounding may depend on
> the locale? If that's the case and if PostgreSQL implements such
> gimmicks then the correct default for money would be to return it to
> Python as string and let the user decide how to proceed from there.

Banker's rounding doesn't occur at all by default with the money type since it doesn't represent values outside it's
locale-dependentscale, but any real->money conversion must occur in the database to account for this possibility.  

> the type should effectively
> be treated as an opaque text value

is what I wrote above. Python can't really do anything with the value other than to display it.

Cheers,
M

В списке psycopg по дате отправления:

Предыдущее
От: Federico Di Gregorio
Дата:
Сообщение: Re: How to use the postgresql money type?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: How to use the postgresql money type?