Re: How to use the postgresql money type? - Mailing list psycopg

From A.M.
Subject Re: How to use the postgresql money type?
Date
Msg-id 2AFC89AC-2F73-4D7D-A42A-004E89BB05C3@themactionfaction.com
Whole thread Raw
In response to Re: How to use the postgresql money type?  (Federico Di Gregorio <federico.digregorio@dndg.it>)
List 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 by date:

Previous
From: Federico Di Gregorio
Date:
Subject: Re: How to use the postgresql money type?
Next
From: Adrian Klaver
Date:
Subject: Re: How to use the postgresql money type?