CONCAT function adding extra characters

From: AI Rumman <rummandba(at)gmail(dot)com>
To: pgsql-general General <pgsql-general(at)postgresql(dot)org>
Subject: CONCAT function adding extra characters
Date: 2021-06-15 18:55:52
Message-ID: CAGoODpdy0zyMbsOCb5n78yM4v2UvWeb2GT9WyCnH1YtSxkcYZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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?

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2021-06-15 19:00:24 Re: CONCAT function adding extra characters
Previous Message Holtgrewe, Manuel 2021-06-15 15:53:54 Re: [ext] Re: Losing data because of problematic configuration?