Difference between Python and Postgres locale currency formats

From: Christian Jauvin <cjauvin(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Difference between Python and Postgres locale currency formats
Date: 2013-04-08 17:01:48
Message-ID: CAJSE4Tr-=eke9XFK4CTnVvpjHhhrRec-8ROLTgz0RGFnyyOGYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

First, I already posted that question to SO, if you prefer to answer it there:

http://stackoverflow.com/questions/15882501/difference-between-python-and-postgres-locale-currency-formats

Using Python 2.6, I get:

import locale
locale.setlocale(locale.LC_MONETARY, 'fr_CA.UTF-8')
locale.currency(1.234) # '1,23 $'

while using Postgres 9.1:

set lc_monetary = 'fr_CA.UTF-8';
select 1.234::money; -- '$1,23'

I think the Python version is the right one (not 100% sure though),
but how can they possibly be different?

Thanks,

Christian

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jeff Janes 2013-04-08 17:28:42 Re: pg_stat_get_last_vacuum_time(): why non-FULL?
Previous Message David Boreham 2013-04-08 17:00:02 Re: Hosting PG on AWS in 2013