Received: from erm1.u-strasbg.fr (erm1.u-strasbg.fr [130.79.74.61]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eAKEpZs20854 for ; Mon, 20 Nov 2000 09:51:35 -0500 (EST) (envelope-from bboett@erm1.u-strasbg.fr) Received: (qmail 23750 invoked by uid 501); 20 Nov 2000 15:08:26 -0000 Date: Mon, 20 Nov 2000 16:08:26 +0100 From: Bruno Boettcher To: pgsql-sql@postgresql.org Subject: Re: More stupid questions: prettyprinting of ints?? Message-ID: <20001120160826.B25191@erm1.u-strasbg.fr> Reply-To: bboett@erm1.u-strasbg.fr References: <20001120154501.A25191@erm1.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i In-Reply-To: <20001120154501.A25191@erm1.u-strasbg.fr>; from bboett@erm1.u-strasbg.fr on Mon, Nov 20, 2000 at 03:45:01PM +0100 X-Archive-Number: 200011/152 X-Sequence-Number: 183 yeah forgot another thing.... i want also to write a SQL trigger to parse incoming fields for preprocessing before DB insertion.... in perl i would do a thing like that: $format = "9999.999.999,99"; #took out of DB... #inserting a number into the db.... $theval =~ s/\.//g; if($theval =~/\S+,\d{2}/) { $theval =~ s/,//g; $theval *= 100; } #extracting a number from the db.... $f= $#format; $i= $#theval; $res = ""; while($i>=0) { if($format[$f] neq "9") { $res = $format[$f].$res $f--; }#if($format[$f] neq "9") $res = $theval[$i].$res ; $i--; $f--; }#while($i>=0) any chance i could this get out of the frontend into the DB? (as sayd want to write more frontends so the less is in the frontend and the more in the DB...) -- ciao bboett ============================================================== bboett@earthling.net http://inforezo.u-strasbg.fr/~bboett http://erm1.u-strasbg.fr/~bboett =============================================================== the total amount of intelligence on earth is constant. human population is growing....