[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] "currency convert" oddity or bug?
Hi Klaus,
I used a USERTAG to do price conversion (converting DM to EURO). I found
the setlocale cluttered the templates and it didn't work properly.
I hope it helps. It should be no problem to adapt it to different
currencies.
You could define a tag for each currency ( [CZ],[US],[GB],etc.. ).
add to catalog.cfg:
UserTag euro Interpolate
UserTag euro HasEndTag
UserTag euro Routine <<EOR
sub{
my($dm_betrag)= @_;
my $euro_betrag = $dm_betrag / 1.95583;
$euro_betrag = sprintf("%.2f", $euro_betrag );
$euro_betrag =~ s/\./,/g;
return "EUR ".$euro_betrag;
}
EOR
usage: [euro]amount[/euro]
for example: [euro][item-price noformat=1][/euro]
have fun!
Robert
_________________________________________________________
Robert Schaller Internet Technologies
Weingartenstr. 49, 73054 Eislingen, Germany
Tel.+Fax: +49-(0)7161-815423, E-Mail: robert@schaller.com
http://www.RobertSchaller.com