PostgreSQL CAST() giving unexpected results
Based on your last comment,

JavaScript parseFloat("34.55555555555595149").toPrecision(15) 

the cast should be to the numeric datatype

CAST ('input' AS numeric(17,15))


https://www.postgresql.org/docs/8.1/static/datatype.html#DATATYPE-NUMERIC-DECIMAL