Re: float8 transmitted in ascii
| От | Tom Lane |
|---|---|
| Тема | Re: float8 transmitted in ascii |
| Дата | |
| Msg-id | 35729.1430351992@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: float8 transmitted in ascii (Dave Cramer <pg@fastcrypt.com>) |
| Ответы |
Re: float8 transmitted in ascii
|
| Список | pgsql-jdbc |
Dave Cramer <pg@fastcrypt.com> writes:
> If I understand you correctly in java you did:
> select 47.88::DOUBLE PRECISION,
> (47.88::DOUBLE PRECISION)::text,
> (47.88::DOUBLE PRECISION)::numeric,
> replace((47.88::DOUBLE PRECISION)::text, '.', ',');
> and the two numeric values are correct, but the text values are wrong ?
extra_float_digits explains it all, I'm sure.
regression=# select 47.88::DOUBLE PRECISION,
(47.88::DOUBLE PRECISION)::text,
(47.88::DOUBLE PRECISION)::numeric,
replace((47.88::DOUBLE PRECISION)::text, '.', ',');
float8 | text | numeric | replace
--------+-------+---------+---------
47.88 | 47.88 | 47.88 | 47,88
(1 row)
regression=# set extra_float_digits = 3;
SET
regression=# select 47.88::DOUBLE PRECISION,
(47.88::DOUBLE PRECISION)::text,
(47.88::DOUBLE PRECISION)::numeric,
replace((47.88::DOUBLE PRECISION)::text, '.', ',');
float8 | text | numeric | replace
---------------------+---------------------+---------+---------------------
47.8800000000000026 | 47.8800000000000026 | 47.88 | 47,8800000000000026
(1 row)
regards, tom lane
В списке pgsql-jdbc по дате отправления: