Re: [PATCHES] Fixes for MONEY type using locale
От | Bruce Momjian |
---|---|
Тема | Re: [PATCHES] Fixes for MONEY type using locale |
Дата | |
Msg-id | 200711270532.lAR5W9O17619@momjian.us обсуждение исходный текст |
Ответ на | Re: [PATCHES] Fixes for MONEY type using locale ("Joshua D. Drake" <jd@commandprompt.com>) |
Список | pgsql-hackers |
Joshua D. Drake wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On Mon, 26 Nov 2007 23:47:04 -0500 (EST) > Bruce Momjian <bruce@momjian.us> wrote: > > > Perhaps all we need is a way to accomplish the casting so it isn't > > automatic. This works: > > > > test=> SELECT regexp_replace('2343'::money::text, '[^$,]*', > > '', 'g')::numeric; regexp_replace > > ---------------- > > 2343.00 > > (1 row) > > > > but the '$' and ',' are locale-specific and I can't think of a way to > > do this generically. > > With a regex? The problem is there is no locale-independent way to determine if '123.456' is ~123k or ~123. I think we are going to need a way to output the MONEY value without a currency and thousands symbols. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://postgres.enterprisedb.com + If your life is a hard drive, Christ can be your backup. +
В списке pgsql-hackers по дате отправления: