[ic] Formatting the price

Mike Heins mikeh@minivend.com
Tue, 27 Feb 2001 07:51:43 -0500


Quoting joachim.richter (joachim.richter@usvideocenter.de):
> I have a rather curious problem
> 
> we are trying to assign different prices for different user upon login, so far everything worked out fine
> we added 3 fields in the products database and called them price2, price3 and price4
> we added 1 field in the userdb and called it pricefield
> we changed our config in that way
> ....
> Autoload <<EOR
> [perl]
>     if($Scratch->{dealer}) {
>             $Config->{PriceField} = $Values ->{pricefield};
>     }
> [/perl]
> EOR
> ....
> Locale de_DE frac_digits 2
> Locale de_DE p_cs_precedes 0
> Locale de_DE p_sep_by_space 2
> Locale de_DE mon_decimal_point   ,
> Locale de_DE mon_thousands_sep .
> #LocaleDatabase  locale
> 
> in the html pages we get an price output by using [item-price]
> 
> Why is it that somehow interchange "swallows" the last two digits instead of
> DM 15,95 it displays DM 15,00 it also calculates the shopping cart with the
> wrong price (missing 2 digits).
> 

Sounds like you are assuming you can store the price in the database as
15,95. That is not so. It must be in LC_ALL=C format, i.e. 15.95. The
display will be correct.

-- 
Red Hat, Inc., 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <mheins@redhat.com>

If you think nobody cares if you're alive, try missing a couple of
car payments.  -- Earl Wilson