Skip site navigation (1) Skip section navigation (2)

Re: National Number to text conversion

From: Jorge Godoy <jgodoy(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: brian ally <brian(at)zijn-digital(dot)com>
Subject: Re: National Number to text conversion
Date: 2006-05-29 15:50:39
Message-ID: 200605291250.40701.jgodoy@gmail.com (view raw or flat)
Thread:
Lists: pgsql-general
Em Segunda 29 Maio 2006 12:22, brian ally escreveu:
> I was thinking the same. But Bob's reply has me wondering if there are
> any online resources for this sort of thing. Specifically, i have a
> look-up table, with most (possibly all - i don't know) countries'
> 2-letter ISO codes and english names. Just this weekend, i've learned
> that i'll require the names in french, as well. I'd thought about
> feeding the names to Babelfish, but, if such a list exists somewhere
> that'd be a real time saver.

At least for pt_BR (Brazilian Portuguese) there are lots of functions around 
that can be used.  What they have of "bad" is that the names are expressed as 
an array inside the function itself.

I believe that the suggestion was to use one of these functions -- for any 
language, with modifications for number gender, as said it is needed in 
arabian -- and instead of storing the names in an array storing them in a 
table would be interesting.

I believe that this table should contain:

  - numbers from 0 to 20, 30, 40, 50, 60, 70, 80, 90, 100 (this has a 
variation in pt_BR), 200, 300, 400, 500, 600, 700, 800, 900, 1000
  - suffixes for thousands, millions, billions, etc.
  - suffixes for fractions (cents, dimes, quarters, etc.)
  - gender (in pt_BR they are genderless, in pt the male gender is the 
dominant with regards to the language, so I'd define the male gender as 
default in a function...)
  - language (if this becomes a function to share with other people, I'd make 
English the default)
  - groupping character, decimal separator (in pt_BR and en_US they are 
reversed, for example)


I don't see it easily done in a multi-language way due to several 
particularities of each language...  If this is going to be used for money, 
things might get a bit harder (IIRC, in Portugal they have the money symbol 
after the integer part and before the decimal part, making it a new "decimal" 
separator...)... 

Anyway, this is what I believe was suggested to be done :-)  Sorry for being 
so discursive...

-- 
Jorge Godoy           <jgodoy(at)gmail(dot)com>

In response to

pgsql-general by date

Next:From: Tom LaneDate: 2006-05-29 15:54:42
Subject: Re: National Number to text conversion
Previous:From: Eci SoujiDate: 2006-05-29 15:34:56
Subject: Re: Free 1000 Rupee bank note

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group