Re: Rounding to even for numeric data type - Mailing list pgsql-hackers

From Gavin Flower
Subject Re: Rounding to even for numeric data type
Date
Msg-id 55171058.5010107@archidevsys.co.nz
Whole thread Raw
In response to Re: Rounding to even for numeric data type  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: Rounding to even for numeric data type  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-hackers
On 28/03/15 21:58, Dean Rasheed wrote:
[...]
>
> Andrew mentioned that there have been complaints from people doing
> calculations with monetary data that we don't implement
> round-to-nearest-even (Banker's) rounding. It's actually the case that
> various different financial calculations demand different specific
> rounding modes, so it wouldn't be enough to simply change the default
> - we would have to provide a choice of modes.
[...]

Could the 2 current round functions have cousins that included an extra 
char parameter (or string), that indicated the type of rounding?

So we don't end up with an explosion of rounding functions, yet could 
cope with a limited set of additional rounding modes initially, and 
possibly others in the future.


Cheers,
Gavin





pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: INSERT ... ON CONFLICT IGNORE (and UPDATE) 3.0
Next
From: Andreas Karlsson
Date:
Subject: Re: Index-only scans with btree_gist