I have some data in money column, database is postgrsql, by default two decimal digits are coming in select query result, I can truncate or replace last three chars to achieve my goal, Is there any function or other efficient way to do it.
select mycolumn from mytable;
output is $256,352.00
output should be $256,352
Cast it to a numeric type, then you can use the to_char()
function to format the value:
select to_char(mycolumn::numeric, '$FM999,999')
from mytable
to_char()
gives you a wide range of formatting options. See the manual for details.