Now sure about Athena, but for Trino I am using
Athena
SELECT regexp_extract(format('%.20f', x), '^(-?\d+\.\d+?)(0*)$', 1)