[ic] PricePictures and Calculations with Perl
Xenia Diaz Orejarena
diaz at peppermind.de
Mon Sep 22 19:28:02 EDT 2003
Hi all,
the problem is, that I can't calculate with Perl with values like
[subtotal]. After the execution of calculating the Results are always
missing there decimal places like:
13.40 + 10 = 23.00
I have no idea, what's going on there. What ist the problem between Perl and
interchange in this case.
The Price-Picture-Definitions in catalog.cfg are as follows:
Locale eur_EUR mon_decimal_point .
Locale eur_EUR price_picture "######.##"
[calc]
my $mwst = ( $Tag->subtotal() * 16 ) / 116 ;
$mwst = sprintf("%.2f",$mwst);
$Tag->set("mwst", $mwst);
my $flgs = sprintf("%.2f",$Tag->scratch("flaschen_ges"));
if ($flgs > 6 && [subtotal] < 250){
$Tag->set("vpp", "10.00");
$gesamt = '[subtotal]' + '10.00';
}elsif($flgs <= 6 && [subtotal] > 250){
$Tag->set("vpp", "6.50");
$gesamt = '[subtotal]' + '6.50';
}
$gesamt = sprintf("%.2f",$gesamt);
$Tag->seti("ges_preis", $gesamt);
return;
[/calc]
I'd bee very happy, if anybody could give me a hint for solving this
problems.
regards,
xul
More information about the interchange-users
mailing list