[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?
catalog.cfg:
CodeDef two_digits Filter
CodeDef two_digits Routine <<EOR
sub {
my $val = shift;
return sprintf('%.2f', $val);
}
EOR
[filter two_digits]8.361344[/filter]
or
[filter op=two_digits interpolate=1] ... ITL ... [/filter]
(untested)
Racke
--
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