[ic] How to display as integer
Stefan Hornburg
interchange-users@icdevgroup.org
Wed Oct 16 11:30:01 2002
On Wed, 16 Oct 2002 15:25:54 +0100
"marc.brevoort" <marc.brevoort@armazemdedados.com> wrote:
> On Wednesday 16 October 2002 14:57, you wrote:
>
> > I'm using 4.8.6 with a modified foundation catalog. I'm looking for a
> > way to display only the integer part of a real number. I've added a
> > column to my products table called "min_qty" which is the minimum
> > quantity of an item that can be ordered. Currently this gets displayed
> > as for example "10.00" but I want it to show up as "10". Any ideas other
> > than changing the database column attributes?
>
> A relatively elegant way is to create a file int.tag in your
>
> /usr/lib/interchange/lib/UI/usertag
>
> directory, with the following contents:
>
> UserTag int hasEndTag
> Usertag int Routine <<EOR
> sub {
> my ($arg) = @_;
> return sprintf("%d",$arg);
return int($arg) is a little bit more straightforward.
Ciao
Racke