[ic] locale - apply changes - where do the pennies go?

Mike Heins interchange-users@icdevgroup.org
Wed Jan 15 18:33:00 2003


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]


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.

If there is something wrong that can actually be described and duplicated,
I am sure it will be trivial to fix. But so far I see nothing.

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.513.523.7621      <mike@perusion.com>

Software axiom: Lack of speed kills.