[ic] price display problem

Mike Heins mikeh@minivend.com
Sat, 11 Nov 2000 10:04:17 -0500

Quoting Toni Mueller (support-ic@oeko.net):
> Hello,
> while working on a checkout page and trying to display I
> have the following problem:
> I want to display mixed DM and EURO pricing, and after
> some [calc]s decided that I like the [locale] mechanism
> as described in the FAQ better.
> In the left column where the price per article is displayed,
> everthing looks nice. In the column to the right where the
> subtotals are, there I find the following problems:
> - When simply saying [item-subtotal] inside the locale section,
>   it mangles the amount because it somehow wants to calculate
>   the new amount based on the string value of the original
>   price (which fails since thousands separator is set to '.'),
>   resulting in very small amounts if there is a price with at
>   least 4 left digits.
> - Working around this using a scratch variable does help to
>   display a reasonable amount, but effectively disables any
>   quantity or otherwise non-linear pricing (I used [item-price
>   [item-quantity] noformat] as a simplistic formula).
> - There is no easy way to get a reasonable subtotal. For no
>   reason known to me (yet) the subtotal is at the EURO value
>   instead of the DM value, but when displayed in the subtotal
>   box, it is shown as DM (and, of course, included with
>   [setlocale de_DE]). The corresponding EURO value is also
>   only a minor change, not the real amount.
> I feel a bit stupid at this point and welcome any hints :(

I think the problem is the iterating lists which perhaps don't 
produce their values like you think.

For instance


			Standard: [item-price]
		    [setlocale eu_EU]
			Euro: [item-price]

will not work, because [item-price] is done at [item-list] time.

This should work:


			Standard: [price code="[item-code]"]
		    [setlocale eu_EU]
			Euro: [price code="[item-code]"]

Akopia, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <heins@akopia.com>

Friends don't let friends use Outlook. -- Bob Blaylock