Re: problem with to_char

Поиск
Список
Период
Сортировка
От Thomas Lockhart
Тема Re: problem with to_char
Дата
Msg-id 3C56A008.E05D299@fourpalms.org
обсуждение исходный текст
Ответ на problem with to_char  (Carsten Grewe <DerReisende@schatzis.org>)
Ответы Re: problem with to_char  (Karel Zak <zakkr@zf.jcu.cz>)
Список pgsql-general
> I think I have not understood some elementary things of the to_char function
> in pgsql7.1.2. I only get back a mask instead of a formatted string.
> I tried the following in psql:
> SPS=> select to_char(45145, '9.999,99');
>   to_char
> -----------
>   #.###,##
> (1 row)

The number will not fit into the field you have defined, so it is filled
with hash marks to indicate overflow.

If your locale is not set up to recognize "european style" numbers, then
in this case you have defined a formatting string which allows only
numbers less than 10. If you are set up to recognize european formatting
(I'm not familiar with this for to_char(); see the docs) then you have
defined a formatting string with allows only numbers less than 9999,
which still won't hold the number you are asking it to format for you.

Try to_char(45145, '99,999.99') and to_char(45145, '99.999,99'); one of
them will work.

hth

                     - Thomas

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

Предыдущее
От: "Ben-Nes Michael"
Дата:
Сообщение: unique & update
Следующее
От: Frank Schafer
Дата:
Сообщение: Re: unique & update