[ic] How to display as integer

marc.brevoort interchange-users@icdevgroup.org
Wed Oct 16 10:26:01 2002


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);
}
EOR

Then restart the server. This will make interchange only print the integer 
part of your number if it is enclosed in [int] [/int] tags. If you need 
rounding as well, you can add .5 to the value being displayed.

Hope this helps,

Marc Brevoort