Re: Round(DP Or numeric ) returns integer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: bhagyashreesalunkhe25(at)gmail(dot)com
Cc: pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Round(DP Or numeric ) returns integer
Date: 2019-01-31 14:50:04
Message-ID: 2262.1548946204@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

PG Doc comments form <noreply(at)postgresql(dot)org> writes:
> 1) The function round( dp or numeric ) always has return type integer not
> same as our parameter is.
> 2) The function round( dp or numeric, s int ) returns the same type as our
> parameter is not an integer type.

Huh?

postgres=# \df round
List of functions
Schema | Name | Result data type | Argument data types | Type
------------+-------+------------------+---------------------+------
pg_catalog | round | double precision | double precision | func
pg_catalog | round | numeric | numeric | func
pg_catalog | round | numeric | numeric, integer | func
(3 rows)

The description in the docs matches reality AFAICS.

regards, tom lane

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2019-01-31 14:52:45 Re: Release Notes for PostgreSQL v10.4 is same as release 9.6.9
Previous Message PG Doc comments form 2019-01-31 14:07:41 Release Notes for PostgreSQL v10.4 is same as release 9.6.9