[ic] locale: decimals truncated

Alessandro Scudieri interchange-users@icdevgroup.org
Thu Sep 5 10:10:02 2002


> Quoting Alessandro Scudieri (Scudieri@openinformatica.it):
> > Hi,
> > I have problems with locale currency presentation: if  I set any locale
> > different from en_US as the default (eg. it_IT, but I have tried also
with
> > fr_FR and de_DE), decimals of any currency number (price, shipping,
etc.)
> > are truncated (eg. 23,67 -> 23,00). If instead I leave en_US as the
default
> > decimals are ok.
> > Then, following the links (put on index.html):
> > <A HREF="[area href="process/locale/it_IT/page/index"]">Italiano</A>
> > <A HREF="[area href="process/locale/en_US/page/index"]">English</A>
> > decimal are also ok.
> [snip]
> > - catalog.cfg (locale stuff):
> > # Last locale specified is the default.
> > Locale          it_IT LC_CTYPE C
> > Locale          en_US LC_CTYPE C
> >
> > (if I invert this last two lines, again decimals are always truncated to
> > ,00).
> >
> > Is this a my error, a bug or.. a feature?
>
> The first thing we need to determine is the situation. Try setting
> some product prices in the database to N,NN format, leaving the rest
> at N.NN. Are the ones specified at N,NN displaying properly?
>
> That will tell us whether Perl is expecting N,NN in the price data.

Ok, I have tried with this configuration (it_IT last defined):
Locale          en_US LC_CTYPE C
Locale          it_IT LC_CTYPE C
and the products with "," in the price field are displayed ok (eg. 23,56),
while prices with "." are displayed wrong (eg. 23,00)

>
> Then put the price data back to N.NN and try these as your last lines:
>
> Locale          it_IT
> Locale          en_US
> Locale          it_IT default 1
Ok, with this, and "." in decimals, all currency values are displayed
properly and the default locale is italian. But... why ic doesn't read the
"default" row in locale.txt ?

Many thanks!
Scudi
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~
Ing. Alessandro Scudieri
OPEN INFORMATICA Srl (http://www.openinformatica.it)
Piazza Matteotti, 1/3 - 16123 Genova
Tel. 010 2543011 - Fax 010 2544759
E-Mail: scudieri@openinformatica.it
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~