Re: How to sum monetary variables

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: How to sum monetary variables
Дата
Msg-id 4E24C7B1.7020306@postnewspapers.com.au
обсуждение исходный текст
Ответ на Re: How to sum monetary variables  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
On 19/07/2011 6:04 AM, Merlin Moncure wrote:
> I wouldn't even bother testing client implementations that are using
> floating point numbers to do the math -- they are going to be wrong.
> If you snoop around you should find math libraries that handle do a
> better job handling exact numbers for most popular languages.

You'll also need to convince your database interface to use the decimal
library you choose, or get it to return 'numeric' types as strings so
you can convert them with your chosen library yourself.

It'll do you no good to convert from Pg numeric -> floating point ->
exact decimal library format.

--
Craig Ringer

POST Newspapers
276 Onslow Rd, Shenton Park
Ph: 08 9381 3088     Fax: 08 9388 2258
ABN: 50 008 917 717
http://www.postnewspapers.com.au/

В списке pgsql-general по дате отправления:

Предыдущее
От: MS Rao
Дата:
Сообщение: Programmer ( Postgres), Milwaukee - offsite-Remote - onsite
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: Alarm function in PL/pgSQL