Equivalent of DB2 function "decimal(numeric expression, precision, scale)" in PostgreSQL
Seems like that is a different way of writing a cast:

select cast('3.1415926535897932384626433832795' as decimal(12,4)) as pi


returns:

   pi
--------
 3.1416


And 

select cast('3.1415926535897932384626433832795' as decimal(12,6)) as pi


returns:

    pi
----------
 3.141593