Skip site navigation (1) Skip section navigation (2)

Re: BUG #1112: round(float-type does not work)

From: CoL <col(at)mportal(dot)hu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1112: round(float-type does not work)
Date: 2004-03-24 12:39:19
Message-ID: c3rvhj$1hut$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-bugs
hi,

PostgreSQL Bugs List wrote:
> The following bug has been logged online:
> 
> Bug reference:      1112
> Logged by:          Ulf Mehlig
> 
> Email address:      ulf(dot)mehlig(at)zmt-bremen(dot)de
> 
> PostgreSQL version: 7.4
> 
> Operating system:   Debian Linux/i386 "testing"
> 
> Description:        round(float-type does not work)
> 
> Details: 
> 
> After upgrading to 7.4.2 I just discovered that the round(f,d) function does 
> not work as expected (bug or feature?): 
> 
>  xxx=> select round(pi(), 2);
>  ERROR:  function round(double precision, integer) does  not exist
>  HINT:  No function matches the given name and argument  types. You may need 
> to add explicit type casts. 
> 
> Typecasting to "NUMERIC" helps, but in my opinion it should not be necessary 
> to typecast float values for rounding: 
> 
> xxx=> select round(pi()::numeric, 2);
>  round
> -------
>   3.14
> (1 row)

create function round (double precision,integer) returns numeric as ' 
select round($1::numeric, $2); ' language sql immutable;

C.

In response to

pgsql-bugs by date

Next:From: PostgreSQL Bugs ListDate: 2004-03-24 15:40:33
Subject: BUG #1113: Default template databases grant CREATE to PUBLIC
Previous:From: pgsql-bugsDate: 2004-03-24 11:59:34
Subject: Returned due to virus; was:hi

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group