using Postgres 12.4 I found some inconsistencies rounding between float8 to decimal(24,8)
By doing
select
29314.630053404966::float8::decimal(24,8) as num1,
29314.630053404966::decimal(24,8) as num2
the return is:
num1: 29314.63005341 -> wrong
num2: 29314.63005340 -> correct
As you can see the rounding does not work properly
Any way to cast correctly from float8 to decimal(24,8)?