| From: | Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl> |
|---|---|
| To: | Gezeala 'Eyah' Bacuño II <gezeala25(at)yahoo(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: numeric rounding |
| Date: | 2003-10-01 14:13:45 |
| Message-ID: | 20031001141345.GA2528@dcc.uchile.cl |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Tue, Sep 30, 2003 at 06:13:39PM -0700, Gezeala 'Eyah' Bacuño II wrote:
> sorry man, but round function can't be used/doesn't work inside a
> plpgsql function..
Huh?
regression=> create or replace function try_to_round(float) returns float as '
regression'> begin
regression'> return round($1::numeric, 2);
regression'> end;
regression'> ' language plpgsql;
CREATE FUNCTION
regression=> select try_to_round(12.1231231);
try_to_round
--------------
12.12
(1 row)
--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No hay cielo posible sin hundir nuestras raíces
en la profundidad de la tierra" (Malucha Pinto)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | scott.marlowe | 2003-10-01 14:15:15 | Re: Current time inside Transactions |
| Previous Message | pgsql-ml | 2003-10-01 13:27:24 | Is the use of array as PL/PGSQL function arguments ? |