[ic] rounding off

Stefan Hornburg racke at linuxia.de
Sun Jul 18 16:22:26 EDT 2004

On Sun, 18 Jul 2004 21:48:19 +0200
Andre Muller <andrem at technoware.nl> wrote:

> Guys,
> Is there an ic function to round off amounts to 2 decimal digits? I have 
> some calculations to do which results into something like 
> €8.36134453781512, which looks quite odd on checkout ;)
> Any suggestions?


CodeDef two_digits Filter
CodeDef two_digits Routine <<EOR

sub {
     my $val = shift;

     return sprintf('%.2f', $val);

[filter two_digits]8.361344[/filter]


[filter op=two_digits interpolate=1] ... ITL ... [/filter]



LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

More information about the interchange-users mailing list