[ic] $Tag->total_cost Giving Spurious Result?

interchange at tvcables.co.uk interchange at tvcables.co.uk
Mon Apr 18 05:39:17 EDT 2005

Quoting Stefan Hornburg <racke at linuxia.de>:

> On Mon, 18 Apr 2005 02:36:02 -0600
> interchange at tvcables.co.uk wrote:
> > Hi folks,
> >
> > Running IC 5.2.0 and the total_cost tag in perl is giving me spurious
> results,
> > it seems to be *sometimes* (50/50) not adding the shipping value.
> [total-cost]
> > always returns the correct total cost its just when using it in perl. Here
> is
> > the snippet of code, can anyone suggest why this does not always give the
> > correct total cost.
> >
> > [perl]
> > my $price = $Tag->total_cost({noformat => 1,});
> > $Scratch->{new-total} = sprintf("%.2f", $price);
> > [/perl]
> Maybe total_cost tries to access a database table and isn't allowed to do so.
> Bye
> 	Racke

Hi Racke,

Maybe but would it sometimes work if that was the case, I find that for some
shipping methods it gives the correct amount for others it doesn't. It may not
be specifically linked to a shipping method but be something to do with the
value of the shipping.

What I am actually trying to do is get [total-cost] with two decimal places
only, [total-cost noformat=1] is returning about 6 decimal places. Can you
suggest another method to achieve this that will work reliably?


This message was sent using IMP, the Internet Messaging Program.

More information about the interchange-users mailing list