Re: numeric rounding - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: numeric rounding
Date
Msg-id 20031001141345.GA2528@dcc.uchile.cl
Whole thread Raw
In response to Re: numeric rounding  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
List 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)

pgsql-general by date:

Previous
From: pgsql-ml@baguette.net
Date:
Subject: Is the use of array as PL/PGSQL function arguments ?
Next
From: Vivek Khera
Date:
Subject: Re: mod_auth_pgsql 2.0.1 don't close the backend connection