[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


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.

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.

I don't have an answer to the actual problem but as a workaround have you tried getting the total cost value first? Something like:

[tmp tc][total-cost noformat=1][/tmp]
[perl tables="products"]
	my $price = $Tag->scratch('tc');
	my $rounded = sprintf("%.2f",$price);
	$Tag->tmp('newtotal', $rounded);
	return "";
[/perl]

RESULT: [scratch newtotal]

====

HTH,

James

--
James Turnbull           suppressed
Web & Database Developer, Scotweb Marketing Ltd
===============================================
http://www.scotweb.co.uk     suppressed
13a Albert Terrace, Edinburgh EH10 5EA

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.