Re: cast numeric with scale and precision to numeric plain
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: cast numeric with scale and precision to numeric plain |
| Дата | |
| Msg-id | 6844.1255969297@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | cast numeric with scale and precision to numeric plain (Sim Zacks <sim@compulab.co.il>) |
| Ответы |
Re: cast numeric with scale and precision to numeric plain
|
| Список | pgsql-general |
Sim Zacks <sim@compulab.co.il> writes:
> Numeric with scale precision always shows the trailing zeros.
> Numeric plain only shows numbers after the decimal point that are being
> used.
That statement is false:
regression=# select 1234.000::numeric;
numeric
----------
1234.000
(1 row)
I'm not sure offhand what is the easiest way to suppress trailing
zeroes, but casting to plain numeric is not the route to a solution.
Really this is a textual formatting problem. You might find that the
best bet is something with trim() or a regexp. The trick would be
not removing zeroes that are significant ...
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера