Re: Allow round() function to accept float and double precision

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>, David Rowley <dgrowleyml@gmail.com>, Sayyid Ali Sajjad Rizavi <sasrizavi@gmail.com>, pgsql-hackers@lists.postgresql.org
Date: 2022-12-01T19:30:56Z
Lists: pgsql-hackers
On Thu, Dec 1, 2022 at 7:39 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Dean Rasheed <dean.a.rasheed@gmail.com> writes:
>
> > The fact that passing a negative scale to round() isn't documented
> > does seem like an oversight though...
>
> Agreed, will do something about that.
>
>
Thanks. I'm a bit surprised you left "Rounds v to s decimal places." alone
though.  I feel like the prose should also make clear that positions to the
left of the decimal, which are not conventionally considered decimal
places, can be identified.

Rounds v at s digits before or after the decimal place.

The examples will hopefully clear up any off-by-one concerns that someone
may have.

David J.

Commits

  1. Doc: add example of round(v, s) with negative s.