[ic] Price Format

Cameron B. Prince cameron@akopia.com
Wed, 17 Jan 2001 15:01:15 -0600


Good point Warren,

That is certainly a possibility. In the site I used it on, the import/insert
functions did the rounding and only stored 2 digits to the right of the
decimal, so it was not a problem.

But I wasn't able to use advanced SQL group functions in queries on these
columns using their default column types.

Cameron

> -----Original Message-----
> From: interchange-users-admin@lists.akopia.com
> [mailto:interchange-users-admin@lists.akopia.com]On Behalf Of Warren
> Odom
> Sent: Wednesday, January 17, 2001 2:48 PM
> To: interchange-users@lists.akopia.com
> Subject: RE: [ic] Price Format
>
>
> 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
> something
> >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
> which
> all have this format. For him to change this would be extremely time
> consuming.
> I hope there is another way to do this.
>
> Thanks
>
> Mat
>
> Hans-Joachim Leidinger wrote:
>
> > Mathew Jones wrote:
> > >
> > > I am having problems displaying the price of an item in the correct
> format
> > > even though it appears the way I want it in my SQL table. In my SQL db
> the
> > > price for example, would be $25,000. but when I pull up the book info,
> it
> > > displays in interchange as $25.00
> > > Is there a setting I need to change in the catalog.cfg, or a
> special tag
> I
> > > need to place around the [item-price] tag and other price related tags
> such
> > > 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
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users
>
>
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users