[DOCS] Failing example for to_number()

Поиск
Список
Период
Сортировка
От Erwin Brandstetter
Тема [DOCS] Failing example for to_number()
Дата
Msg-id CAGHENJ45ymd=GOCu1vwV9u7GmCR80_5tW0fP9C_gJKbruGMHvQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [DOCS] Failing example for to_number()  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
The manual suggests here:

https://www.postgresql.org/docs/current/static/functions-formatting.html#FUNCTIONS-FORMATTING-TABLE

> to_number(text, text) |  numeric convert string to numeric | to_number ('12,454.8-', '99G999D9S')

The example fails for locales where the comma (',') does not happen to be the group separator and the dot ('.') is not the decimal point.

The example is incorrectly assuming en_US locale. It must instead work locale-agnostic. Replace:

to_number ('12,454.8-', '99G999D9S')

with:

to_number ('12,454.8-', '99,999.9S')


Regards
Erwin Brandstetter

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

Предыдущее
От: bramesh.ppl@gmail.com
Дата:
Сообщение: [DOCS] why money datatype size returns with 2147483647 instead of 19,2
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: [DOCS] Failing example for to_number()