Re: any plans to support more rounding methods in sql?
От | Peter Geoghegan |
---|---|
Тема | Re: any plans to support more rounding methods in sql? |
Дата | |
Msg-id | CAEYLb_URu=woX6NoVEVQ7xmjUQTSw6cYX-V=j8DWK5J1vQBg6Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: any plans to support more rounding methods in sql? (Pavel Stehule <pavel.stehule@gmail.com>) |
Список | pgsql-general |
On 25 January 2012 05:41, Pavel Stehule <pavel.stehule@gmail.com> wrote: > Hello > > 2012/1/25 raf <raf@raf.org>: >> hi, >> >> i just needed to round some numbers down to 4 decimal places but a quick search >> indicated that postgresql doesn't support all of the rounding methods so i had >> to write this dreadful function: Are you talking about always rounding down to the lower smallest-possible-increment, rather than following standard rules for rounding? That isn't such an esoteric use case - I believe that financial regulations in some jurisdictions require just that when calculating interest, for example. If you require exactly 4 digits of precision, it's possible to use this syntax: NUMERIC(precision, scale) That isn't going to affect the rounding behaviour though. -- Peter Geoghegan http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training and Services
В списке pgsql-general по дате отправления: