Received: from fondos.net (fondos.net [208.234.1.135]) by hub.org (8.9.3/8.9.3) with ESMTP id IAA15414 for ; Mon, 29 Nov 1999 08:12:44 -0500 (EST) (envelope-from oserra@fondos.net) Received: from pep ([213.4.29.112]) by fondos.net (8.8.8/8.8.5) with SMTP id IAA09078 for ; Mon, 29 Nov 1999 08:13:05 -0500 Message-ID: <002801bf3a6b$68d27d40$701d04d5@pep> From: "Oscar Serrano" To: References: <199911280627.BAA13538@lee.k12.nc.us> Subject: RE: [INTERFACES] Spanish format on date and numbers Date: Mon, 29 Nov 1999 14:12:15 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 ----- Original Message ----- From: James Olin Oden To: Oscar Serrano Sent: Sunday, November 28, 1999 7:27 AM Subject: Re: [INTERFACES] Spanish format on date and numbers > > > > This is a multi-part message in MIME format. > > > > ------=_NextPart_000_002B_01BF383C.AE4DF100 > > Content-Type: text/plain; > > charset="iso-8859-1" > > Content-Transfer-Encoding: quoted-printable > > > > > > Hi: > > I'm from Spain. I've exported some tables from MS Access to Postgres. = > > You > > know, in Spain, a number like this: 1,234.56 me write it like this: > > 1.234,56 > > i.e., the thousand separator is the "." and the decimal separator is the = > > "," > > > > I'm going to use Perl (DBI) to get the data from the databases. > > Is there anyway so DBI or postgress gives me the data in the spanish = > > format? > > > > I wouldn't like to use somethink like this: > > $result=3D~s/\./,/g; > > to convert all "." to "," and vice-versa. > > > Certainly you can use the substitution operator to replace the .'s with ,'s > and the ,'s with .'s. The main problem is that the first substitution you > make will cause all one character to become the character you are about > to convert next. As in: > > 1,234.52 > > becomes: > > 1.234.52 > > when replacing your comma. So on the next step you have no nice way of telling > which is the real . you wish to replace with ,. One way around this is to > replace one of the symbols with a third symbol not found in a number: > > $result =~ s/\./\@/g; # Periods to @'s > $result =~ s/\,/\./g; # commas to periods > $result =~ s/\@/\,/g; # @'s to commas > > On the other hand if you don't use the susbstitution operator and instead > use tr, the translation operator, you can get away with doing it in > one fell swoop: > > $result =~ tr/.,/,./; > > and that should do it (-: I never used the tr (translation operator), but I see that in this case is better that the =~s But What I was trying is that postgres returns the values in the spanish format, not having to translate ,'s to .'s and viceversa As I told in previos messages, I thing I must compile Postgres with --use-locale and have defined some variables. But I'm not sure how to define that variables, and in case I have them well defined, I don't know if it is needed extra configuration in my Linux, or have installed any spanish library or whatever. Thank you very much. > ...james > > Thank you very much > > > > ______________________________ > > > > Oscar Serrano > > > > > > > > ------=_NextPart_000_002B_01BF383C.AE4DF100 > > Content-Type: text/html; > > charset="iso-8859-1" > > Content-Transfer-Encoding: quoted-printable > > > > > > > > > http-equiv=3DContent-Type> > > > > > > > > > >

Hi:
I'm from Spain. I've = > > exported some=20 > > tables from MS Access to Postgres. You
know, in Spain, a number like = > > this:=20 > > 1,234.56 me write it like this:
1.234,56
i.e., the thousand = > > separator is=20 > > the "." and the decimal separator is the ","
> >
 
> >
I'm going to use Perl (DBI) to get the = > > data from=20 > > the databases.
Is there anyway so DBI or postgress gives me the data = > > in the=20 > > spanish format?
> >
 
> >
I wouldn't like to use somethink like=20 > > this:
$result=3D~s/\./,/g;
to convert all "." to "," and=20 > > vice-versa.
> >
 
> >
Thank you very much
> >
 
> >
> size=3D2>______________________________
> >
 
> >
Oscar Serrano
> >
 
> >
 
> > > > ------=_NextPart_000_002B_01BF383C.AE4DF100-- > > > > > > ************ > > >