Re: numeric to text (7.3)

Поиск
Список
Период
Сортировка
От Szima Gábor
Тема Re: numeric to text (7.3)
Дата
Msg-id Pine.LNX.4.50.0212022047270.913-100000@vigo.sygma.net
обсуждение исходный текст
Ответ на Re: numeric to text (7.3)  (Rod Taylor <rbt@rbt.ca>)
Список pgsql-hackers
On Mon, 2 Dec 2002, Rod Taylor wrote:

>  double precision | pg_catalog | round          | double precision
>  numeric          | pg_catalog | round          | numeric
>  numeric          | pg_catalog | round          | numeric, integer
>
> Looks like round still exists to me.

Rod, you don't understand me. :)

I needn't round, or the valueless zeroes too.

It's good (in older version of pSQL):
2.000::numeric -> 2
2.001::numeric -> 2.001


It's "ugly" (in 7.3):
2.000::numeric -> 2.000
2.001::numeric -> 2.001
or
round(2.000::numeric,2) -> 2.00
round(2.001::numeric,2) -> 2.00


Joel had got a good idea:

joel@joel=# select rtrim(rtrim('2.000'::numeric, '0'),'.');rtrim
-------2
(1 row)

.. but i prefer the old text(numeric) function :)


Thanks!

                        -Sygma


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

Предыдущее
От: Szima Gábor
Дата:
Сообщение: Re: numeric to text (7.3)
Следующее
От: "Christopher Kings-Lynne"
Дата:
Сообщение: Re: Backend crash with tsearch