Search Postgresql Archives

Re: CONCAT function adding extra characters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> út 15. 6. 2021 v 20:56 odesílatel AI Rumman <rummandba@xxxxxxxxx> napsal:

> 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
>
>
> Value 41.1 which double precision converts to 41.1000000014.
>
> Is that expected?
>

Hi

0.1 cannot be represented exactly in binary so that does not look out of
line. There are also some config options for extra digits and what not
that may affect the result of a cast.

Regards,
Ken





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux