[ic] Price Format

Warren Odom warren-odom@stenocall.com
Wed, 17 Jan 2001 14:47:52 -0600

If it's an SQL database as you say, you might think about just adding
another column with the price figures formatted the way you need.  You'd
have to make sure any updates affected both columns, of course-either by
modifying the price-updating routine to do them both at once, or by
periodically running a process that updated the whole thing.

>You might also consider changing the column types in the database
>definitions to something like FLOAT(4) anywhere a dollar amount is
>stored. I have had to do this before, especially if I needed to do
>like select sum(subtotal) from transactions.

Using floating point prices is not advisable because it can lead to roundoff
error.  Using fixed decimal storage format is long-established practice, for
good reasons.

           -- Warren

-----Original Message-----
From:	interchange-users-admin@lists.akopia.com
[mailto:interchange-users-admin@lists.akopia.com] On Behalf Of Mathew Jones
Sent:	Wednesday, January 17, 2001 2:25 PM
To:	interchange-users@lists.akopia.com
Subject:	Re: [ic] Price Format

Great advice, however my client has over 20,000 itmes in his local database
all have this format. For him to change this would be extremely time
I hope there is another way to do this.



Hans-Joachim Leidinger wrote:

> Mathew Jones wrote:
> >
> > I am having problems displaying the price of an item in the correct
> > even though it appears the way I want it in my SQL table. In my SQL db
> > price for example, would be $25,000. but when I pull up the book info,
> > displays in interchange as $25.00
> > Is there a setting I need to change in the catalog.cfg, or a special tag
> > need to place around the [item-price] tag and other price related tags
> > as total, subtotal, extension??
> The best way is to format all price in your SQL talble without any
> character like $. Make a test and replace $25,000 to 25,000.00 or
> 25000.00 and see what you get.
> Joachim
> --
> -------------Hans-Joachim Leidinger---------------------
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users

Interchange-users mailing list