[ic] locale - apply changes - where do the pennies go?
Stefan Hornburg
interchange-users@icdevgroup.org
Wed Jan 15 18:47:01 2003
On Wed, 15 Jan 2003 18:32:23 -0500
Mike Heins <mike@perusion.com> wrote:
> Quoting Stefan Hornburg (Racke) (racke@linuxia.de):
> > On Wed, 15 Jan 2003 17:10:00 -0500
> > Mike Heins <mike@perusion.com> wrote:
> >
> > > Quoting Stefan Hornburg (Racke) (racke@linuxia.de):
> > > > On 15 Jan 2003 10:55:19 -0500
> > > > John Matecsa <matecsaj@picassofish.com> wrote:
> > > >
> > > > > Since I've been using locale features to dynamically switch between
> > > > > French and English with Interchange 4.8.6 I've had a puzzling problem.
> > > >
> > > > Please specify "dynamically switch".
> > > >
> > > > >
> > > > > In the back end, if I "apply changes", the pennies on item prices in the
> > > > > back and front end are truncated to zero. This affects more than just
> > > > > the catalog that changes were applied too. As soon as I restart
> > > > > Interchange the pennies come back. The problem runs deeper than currency
> > > > > presentation, items sold, are recorded with pennies truncated to zero in
> > > > > the database.
> > > > >
> > > > > Note that I've added rows to the locale table, but haven't deleted or
> > > > > modified what was there to begin with.
> > > > >
> > > > > Any suggestions?
> > > >
> > > > I'm pretty sure that Interchange is buggy with switching locales. There are
> > > > a number of reports which describe odd behaviour of Interchange, especially
> > > > dropping fractional numbers. For one thing, you cannot switch the currency
> > > > twice on an Interchange page without wreaking havoc. Though I'm really
> > > > interested in Interchange's i18n features, I fear I cannot do much about
> > > > it due to limited resources.
> > >
> > > I believe these problems go away completely if you just set LC_ALL to "C"
> > > before starting Interchange.
> >
> > Switching the currency twice on a page won't work flawlessly regardless of this
> > setting. This is a bug and I reported it in an earlier posting to interchange-core,
> > I guess. Not easy to fix though.
>
> Au contraire:
>
> reconfig=[reconfig]
> [calc]
> @$Items = ();
> $CGI->{mv_order_item} = 'os28004';
> $CGI->{mv_todo} = 'refresh';
> return;
> [/calc]
>
> [update process]
>
> Default: [total-cost]
>
> [setlocale locale=de_DE]
> de_DE: [total-cost]
>
> [setlocale locale=fr_FR]
> fr_FR: [total-cost]
>
> [setlocale locale=en_US]
> en_US: [total-cost]
>
> [setlocale locale=de_DE]
> de_DE: [total-cost]
>
You changed the whole locale, not the currency alone. Try the same sample with
[setlocale currency=..].
>
> Yields for me:
>
> 1
>
> Default: $14.95
>
> de_DE: DM 27,64
>
> fr_FR: 91,61 FF
>
> en_US: $14.95
>
> de_DE: DM 27,64
>
> What is not working? If it cannot be described, it cannot be fixed.
>
> (Run on latest CVS devel.)
>
> Note that I am running with an environment of LC_ALL at "C". If I set it
> to de_DE or some other locale that uses "," as a decimal separator there
> are problems, I agree.
So if ExecutionLocale isn't sufficient to solve the problem with the
broken fractional digits, shouldn't we preset the locale in the init
scripts or is there some other measure like a warning on startup ?
Bye
Racke