Re: More stupid questions: prettyprinting of ints??

From: Bruno Boettcher <bboett(at)erm1(dot)u-strasbg(dot)fr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: More stupid questions: prettyprinting of ints??
Date: 2000-11-20 15:08:26
Message-ID: 20001120160826.B25191@erm1.u-strasbg.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)earthling(dot)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....

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Clayton Cottingham 2000-11-20 15:18:13 Re: MySQL -> Postgres dump converter
Previous Message Shane McEneaney 2000-11-20 15:08:06 Return number of rows update in query