Re: How to avoid: 9.50184e+06

Поиск
Список
Период
Сортировка
От Scott Marlowe
Тема Re: How to avoid: 9.50184e+06
Дата
Msg-id dcc563d10709280716k798f30d6g7a1f1079659fc46d@mail.gmail.com
обсуждение исходный текст
Ответ на How to avoid: 9.50184e+06  (Stefan Schwarzer <stefan.schwarzer@grid.unep.ch>)
Список pgsql-general
On 9/28/07, Stefan Schwarzer <stefan.schwarzer@grid.unep.ch> wrote:
> Hi there,
>
> how can I avoid results like this: 9.50184e+06
>
> Instead it should return the "real" value, as 950184.
>
> Thanks for any hints!

Cast it to numeric:

select 9.50184e+06::real::numeric;

But know that you're losing accuracy if you're working with real / float types.

If you need all the parts of the number kept around, use numeric from the start.

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

Предыдущее
От: "John Smith"
Дата:
Сообщение: Re: access privileges: grant select on (all current and future tables)?
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: access privileges: grant select on (all current and future tables)?