Re: CONCAT function adding extra characters
| От | Pavel Stehule |
|---|---|
| Тема | Re: CONCAT function adding extra characters |
| Дата | |
| Msg-id | CAFj8pRD_7ENdgkSZv6ARFUnixMFrp7Y=C2ffEVCwf-M9FyCkzQ@mail.gmail.com обсуждение исходный текст |
| Ответ на | Re: CONCAT function adding extra characters (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: CONCAT function adding extra characters
|
| Список | pgsql-general |
út 15. 6. 2021 v 21:07 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
AI Rumman <rummandba@gmail.com> writes:
> I am using Postgresql 10 and seeing a strange behavior in CONCAT function
> when I am concatenating double precision and int with a separator.
> select concat('41.1'::double precision,':', 20);
>> Result:
>> 41.1000000000000014:20
What have you got extra_float_digits set to?
postgres=# set extra_float_digits to 3;
SET
postgres=# select concat('41.1'::double precision,':', 20);
┌────────────────────────┐
│ concat │
╞════════════════════════╡
│ 41.1000000000000014:20 │
└────────────────────────┘
(1 row)
SET
postgres=# select concat('41.1'::double precision,':', 20);
┌────────────────────────┐
│ concat │
╞════════════════════════╡
│ 41.1000000000000014:20 │
└────────────────────────┘
(1 row)
Pavel
regards, tom lane
В списке pgsql-general по дате отправления: