Hello,
Steps to reproduce:
create type public.test_type as ( value1 numeric(35,6), value2
numeric(35,6) );
create or replace function public.test( ) returns test_type
language 'sql' as $body$ select 7.136178319899999964,
7.136178319899999964; $body$;
select value1, value2 from test();
Expected: 7.136178 7.136178
Actual: 7.136178319899999964 7.136178319899999964
select value1::numeric(35,6), value2::numeric(35,2) from test();
Expected: 7.136178 7.14
Actual: 7.136178319899999964 7.14
I'm on Centos 7, Postgresql 11.6